# 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](/unit-system/getting-started/manager-window.md).

<figure><img src="/files/R3q1H4Tk3hWyZz5JTK6I" 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);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://travljen.gitbook.io/unit-system/getting-started/database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
