Saving and Loading

Gateway handles saving and loading automatically. As player progress changes, the system schedules saves in the background through the GatewaySavingProvider — no manual wiring required in most cases.
info
Gateway uses a debounced save strategy. Rather than writing to disk on every stat update or challenge completion, saves are coalesced and deferred slightly. This prevents excessive I/O during bursts of activity without any risk of data loss.

Save Slots

If your game supports multiple save slots or player profiles, you can switch the active slot at any time using SwitchSlot. The provider will use the new slot name for all subsequent saves and loads.

Forcing an Immediate Save

In cases where you need to guarantee a save happens right away — such as before returning to a main menu or closing the application — you can bypass the debounce schedule with SaveImmediate.

Listening to Save and Load Events

If you need to react to save or load completions, the provider exposes two delegates: OnSaveCompleted and OnLoadCompleted. Both pass a success flag and either an error message or the loaded save data, depending on the operation. These are useful for surfacing error feedback or gating logic that depends on load completion.