floppy-disksPersistence Scopes

Persistence scopes let you control where your data is saved, either across all scenes or just in a specific scene.

Global

Data is saved everywhere and persists across scenes.

SaveManager.Save("coins", 0, PersistenceScope.Global);

Scene

Data is saved only in the current scene (For example: "Level1").

circle-info

Tip: Use Global for player stats, inventory, or anything that carries across levels. Use Scene for things like door states, positions, etc...

Scope
Lifetime
Use Cases
Example

Global

Entire game

Player stats, inventory, unlocks

Health, coins, level progression

Scene

Current scene only

Level state, enemy positions

Killed enemies, opened chests, checkpoint

Last updated