Inspector Fields
| Field | Type | Description |
startingInventory | InventoryPreset | The default starting loadout applied when no save file exists for the player. |
saveOnDestroy | bool | When disabled, the manager skips writing to disk on destroy. Useful for test scenes that should not overwrite save data. |
Static Properties
| Property | Type | Description |
DiscoveredEquipment | IReadOnlyList<Equipment> | Read-only list of all equipment the player has unlocked across all runs. Backed by save data. |
Static Methods
| Method | Description |
SaveLevel(LevelData data) | Updates the save record for the level referenced by data. Adds a new record if none exists yet. |
GetLevelData(LevelInfo level) → LevelData | Returns the saved progress for the given level, or a default empty record if the level has never been played. |
SaveSoundSetting(string parameterName, float value) | Persists an audio mixer parameter value by name so it survives between sessions. |
GetSoundSetting(string parameterName, float defaultValue = 0f) → float | Returns the last saved value for an audio mixer parameter, or defaultValue if no value has been saved. |
GetAllSoundSettings() → IEnumerable<SoundParameter> | Returns all saved audio mixer parameters. Used by the audio system to restore settings on startup. |
SaveNow() | Forces an immediate write of the current game data to disk. Normally the manager saves automatically on level exit and on destroy. |
AddDiscoveredEquipment(Equipment equipment) | Records a piece of equipment as discovered. Persisted to the save file and reflected in DiscoveredEquipment. |
ℹ️
GameDataManager listens to LevelManager.OnAnySuccessfulExit and saves automatically when the player exits a level. You rarely need to call SaveNow() directly — it is mainly useful when changing critical data outside a level context (for example, after unlocking equipment from the main menu).