# Database

### Editor

**SystemDatabase** is a scriptable object used for managing system **assets**, their unique **ID**s. Initially designed to be used in **Editor**, but it may also be accessed at **runtime**.

You can **register** all assets in the project here or **clear** the database. But creating a new assets should be done through [manager-window](manager-window "mention").

<figure><img src="https://3582497942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy2G6fDLEPuCAcuABMl6j%2Fuploads%2FvQWOPLqJncUIzxjhdibu%2FSystem%20dabatabase.png?alt=media&#x26;token=022839f6-8c41-43c7-a87b-ee0f73e54d5e" alt=""><figcaption><p>Database ScriptableObject UI</p></figcaption></figure>

### Runtime

Items in the database are scriptable objects as well, so they can be as any other asset in unity.

Alternatively you can retrieve them using their IDs from this database.

```csharp
[SerielizeField] private SystemDatabase database;
[SerielizeField] private int resourceID;

private void Awake()
{
    // Or at runtime
    // var database = SystemDatabase.GetInstance();
    
    // Find the asset using its ID.
    var resource = database.FindAssetById(resourceID);
}
```
