Skip to main content

Class ScriptableVariableORM<T>

SQLite ORM row for a single scriptable variable, keyed by a hash of the persistent GUID of the owning BaseScriptableVariable asset.

public class ScriptableVariableORM<T> : IPrimaryKey<int>

Type Parameters​

NameTypeDescription
TThe data type stored in this row (e.g., int, float, string).

Inheritance​

Implements​

IPrimaryKey<int>

Remarks​

The key is derived from the asset's persistent GUID (see GetDatabaseID), not GetInstanceID: instance IDs are per-instance and are reassigned whenever the asset is unloaded and reloaded (e.g., by Addressables between scene loads), which would otherwise orphan previously stored rows.

The table name is derived from T by sqlite-net's ORM conventions, so int and float variables live in separate tables without any additional configuration.

Properties​

Id​

Unity instance ID of the owning BaseScriptableVariable asset, used as the row primary key.

public int Id { get; set; }

Property Value​

int

Value​

The persisted runtime value for this variable.

public T Value { get; set; }

Property Value​

T