Saving & Runtime State
UPFS includes immediate PlayerPrefs persistence for Upgrade and Currency assets. This page explains what is stored, when saves occur and which authoring decisions must remain stable after release.
Storage model
Upgrade SO and Currency SO persist independently under keys derived from their authored identities.
| Asset | Stored data | Automatic save points |
|---|---|---|
| Upgrade SO | Serialized Big Upgrade structure and Small Upgrade completion state | Successful PerformUpgrade |
| Currency SO | Current Int or Float balance | SetValue, ModifyValue and ResetToDefault |
| Economy Handler | No independent wallet save | Uses the referenced Currency and Upgrade saves |
| Info Provider | Authored presentation data in the asset | Not a player progression save |
Recommended runtime lifecycle
-
01
Author stable assets
Finalize unique Upgrade and Currency identities before release.
-
02
Load
Load saved values at the initialization point defined by your project.
-
03
Read and modify
Use public APIs instead of directly editing internal serialized state.
-
04
Save automatically
Standard progression and balance mutations save immediately.
-
05
Reset intentionally
Expose reset actions only in controlled development or player-reset flows.
PlayerPrefs Viewer
Inspect and validate stored values during development.
Renaming and migration
Asset names and configured names can participate in save keys and economy matching.
- Do not rename a released Upgrade Name without migrating its stored JSON to the new key.
- Do not rename a released Currency Name without migrating its typed PlayerPrefs entry.
- Changing Currency type from Int to Float or Float to Int should be treated as a migration.
- Keep Economy currency definition names synchronized with Wallet Currency names.
Integrating another save system
Use UPFS public state and methods as the boundary for a project-specific persistence adapter.
For projects that require cloud synchronization, profiles or encrypted files, centralize the integration in a dedicated adapter rather than spreading persistence logic across UI and gameplay scripts.
Define ownership clearly: either let UPFS PlayerPrefs remain authoritative or make the external save layer authoritative and coordinate loading before gameplay begins.