Vault Save System

Spreadsheet — VaultSheet

A named 2D grid of cells stored inside the active drawer. Perfect for inventories, leaderboards, tile maps, or any tabular data.

Get a Sheet

static VaultSheet Sheet(string name)

Cell Operations

VaultSheet sheet = Vault.Sheet("inventory");

// Write and read individual cells
sheet.Set(0, 0, "Iron Sword");
sheet.Set(0, 1, 99.5f);
string itemName = sheet.Get<string>(0, 0);
float  price    = sheet.Get<float>(0, 1, 0f);  // 0f = default

// Check / clear
bool exists = sheet.HasCell(0, 0);
sheet.ClearCell(0, 1);
sheet.ClearRow(0);
sheet.ClearAll();

Typed Rows

Serialize a whole struct into a row — fields map to consecutive columns.

[Serializable]
struct InventoryItem { public string id; public int quantity; public float value; }

sheet.SetRow(0, new InventoryItem { id = "sword", quantity = 1, value = 99.5f });
sheet.SetRow(1, new InventoryItem { id = "potion", quantity = 5, value = 20f });

InventoryItem item = sheet.GetRow<InventoryItem>(0);
List<InventoryItem> all = sheet.GetAllRows<InventoryItem>();

CSV Import / Export

string path = Path.Combine(Application.persistentDataPath, "scores.csv");
sheet.ExportCsv(path);   // edit in Excel / Sheets
sheet.ClearAll();
sheet.ImportCsv(path);   // import back — types auto-detected

Sheets are sparse — only written cells consume storage. A sheet with entries at rows 0 and 10 000 stores only 2 rows.