Scripting / Scriptable Objects
IdentifiableSO
Abstract base class for ScriptableObjects that need a stable, persistent unique identifier across save and load cycles. Subclass it whenever you need an asset that can be reliably looked up by ID at runtime — for example, items, equipment, and level descriptors.
IdentifiableSO
Extends ScriptableObject. Each concrete asset auto-generates a GUID-based ID the first time it is validated in the editor (OnValidate). The ID is then frozen — it will not change on re-import or rename, making it safe to store in save files and compare at runtime.
Known subclasses in the project: Item, Equipment, LevelInfo.
Properties
| Property | Type | Description |
|---|---|---|
ID | string | Unique identifier for this asset, auto-generated from its GUID on first validation. Read-only at runtime. Do not edit the backing field — doing so breaks any save data that references this asset by ID. |
Never edit the ID field manually. The ID is written once at asset creation time and used as the persistent key in save files. Changing it orphans existing save data that references this asset.
Subclassing
To create a new identifiable ScriptableObject type, inherit from IdentifiableSO. The ID property is inherited automatically — no extra setup is needed.
using UnityEngine; namespace LoopAdventure { [CreateAssetMenu(menuName = "Loop Adventure/My Asset")] public class MyAsset : IdentifiableSO { public string displayName; // ID is inherited — available as this.ID at runtime } }
Lookup by ID. The project's
Database<T> system (populated by DatabaseManager at startup) allows fast retrieval of any IdentifiableSO subclass by its ID, which is how save data references items and equipment without storing asset references directly.