API Index
Vault
| Signature | Description |
SetDrawer(name) | Sets the active drawer. |
SetDefaultDrawer() | Sets the active drawer to "default". |
string ActiveDrawer | Name of the current drawer. |
BeginBatch() | Suspends per-call disk writes. |
EndBatch() | Flushes all pending writes in one operation. |
Save<T>(key, value) | Saves any supported value. |
Load<T>(key, default) | Loads a value; returns default if missing. |
Save(key, so) | Saves all [Save] members on a ScriptableObject. |
Load(key, so) | Restores all [Save] members on a ScriptableObject. |
Save(key, mb, build) | Saves with a component filter builder. |
Load(key, mb, build) | Loads with a component filter builder. |
SaveAsync<T>(key, value) | Background save. Returns Task. |
LoadAsync<T>(key, default) | Background load. Returns Task<T>. |
SaveAsync(key, so) | Save(so) on background thread. |
Exists(key) | Returns true if the key exists. |
Delete(key) | Removes a key and writes. |
DrawerExists() | Returns true if the active drawer file is on disk. |
DeleteDrawer() | Deletes the active drawer and its backup. |
GetAllDrawerNames() | Sorted names of all drawers on disk. |
CopyDrawer(src, dst) | Copies a drawer to a new name. |
DeleteAllDrawers() | Deletes every drawer. |
GetDrawerInfo() | Returns the raw SaveFile for inspection. |
GetDataVersion() | Returns the drawer's migration version. |
SetDataVersion(v) | Stamps the migration version (skips old migrations). |
UpdatePlaytime(seconds) | Increments the drawer's built-in playtime counter. |
Sheet(name) | Returns a VaultSheet for the active drawer. |
VaultSheet
| Signature | Description |
Set<T>(row, col, value) | Sets a cell. Writes immediately. |
Get<T>(row, col, default) | Gets a cell or returns default. |
HasCell(row, col) | True if the cell has a value. |
SetRow<T>(row, value) | Writes a struct's fields as consecutive columns. |
GetRow<T>(row) | Reads a typed struct from consecutive columns. |
GetAllRows<T>() | All rows as List<T> in index order. |
ClearCell(row, col) | Removes one cell. |
ClearRow(row) | Removes all cells in a row. |
ClearAll() | Removes everything in the sheet. |
int RowCount | Number of rows with at least one cell. |
RowIndices() | Enumerates populated row indices. |
ColumnIndices(row) | Enumerates populated column indices in a row. |
BeginBatch() / EndBatch() | Batch writes for sheets. |
ExportCsv(path) | Exports to a sparse CSV file. |
ImportCsv(path) | Imports from a sparse CSV (auto-detects types). |
VaultMigrations
| Signature | Description |
Register(from, to, callback) | Registers a migration for all drawers. |
Register(from, to, callback, predicate) | Registers with a drawer filter predicate. |
int LatestVersion | Highest to version across all steps. |
Clear() | Removes all steps (useful in tests). |
Attributes
| Attribute | Description |
[Save] | Include this field in Save / Load object scanning. |
[Save("key")] | Include with a custom key name. |
[NoSave] | Exclude from scanning. Wins over [Save]. |
[VaultRename("old")] | Load from old key names after a field rename. |
SaveFile
| Member | Description |
string drawer | Drawer name. |
int dataVersion | Migration version. |
float playtime | Total seconds played. |
GetFormattedPlaytime() | Returns "HH:MM:SS". |
GetDateTime() | Local DateTime of last write. |
entries | List<SaveEntry> — all key-value pairs. |
Supported Types
| Category | Types |
| Primitives | int, float, bool, string |
| Extended numerics | double, long, ulong, uint |
| Other | char, DateTime, TimeSpan, Guid |
| Unity math | Vector2/3/4, Vector2/3Int, Quaternion, Matrix4x4 |
| Unity graphics | Color, Color32, Gradient, AnimationCurve |
| Unity geometry | Rect, RectInt, Bounds, BoundsInt, LayerMask |
| Collections | T[], List<T>, Dictionary<K,V> |
| Custom types | Any [Serializable] struct or class |
| Enums | Any enum |
| Unity Components | Rigidbody, Camera, Light, Transform, … all Components (via reflection) |
double, long, DateTime, and Dictionary use Vault's tagged format internally since JsonUtility doesn't support them. This is handled automatically — no action needed.