UpgradeSaveLoadManager

Overview

Persists the state of UpgradeSlotUI entries (e.g., unlocked/obtained) to a simple JSON list. Can work over an explicit upgradeSlots list, or auto-discover all UpgradeSlotUI components (including inactive).

Disk File

  • upgrades_save.json in Application.persistentDataPath.

DTO

Each slot is saved as:

{ "key": "<id>", "title": "<display name>", "unlocked": true, "obtained": false }

Public API

  • void SaveAll() — gathers UpgradeSlotUI.ToDTO() from all slots and writes a pretty-printed wrapper.
  • void LoadAll() — reads and applies via UpgradeSlotUI.TryApply(dto); logs how many were matched.

Notes

  • Human-readable JSON is convenient for QA to verify progression states.