Overview
This Save System is designed for non-programmers and offers:
- Easy designer workflow
- Automatic saving & loading
- Full cross-platform support (PC, Mobile, Consoles, Web)
- Async saving and loading (no frame hitching)
- No additional setup required
1. Mark Fields You Want Saved
Add [SaveField] above any value you want saved:
[SaveField] public int playerLevel;
[SaveField] public float health;
[SaveField] public Vector3 position;
[SaveField] public Quaternion rotation;
Any field marked with [SaveField] will automatically save and load.
2. Create a Save Component
Any script can participate in saving by implementing
ISaveComponent.
public class PlayerStats : MonoBehaviour, ISaveComponent
{
public string SaveKey => "PlayerStats";
[SaveField] public int level;
[SaveField] public float xp;
[SaveField] public float health;
public void OnBeforeSave() { }
public void OnAfterLoad() { }
}
- SaveKey must be unique.
- OnBeforeSave is optional.
- OnAfterLoad is optional.
3. Saving the Game
You can save using synchronous or async calls.
Save immediately:
PlatformSaveSystem.Save("slot1");
Save asynchronously (recommended):
await PlatformSaveSystem.SaveAsync("slot1");
Unity coroutine version:
StartCoroutine(PlatformSaveSystem.SaveAsyncRoutine("slot1"));
4. Loading the Game
Synchronous load:
PlatformSaveSystem.Load("slot1");
Async load:
await PlatformSaveSystem.LoadAsync("slot1");
Coroutine load:
StartCoroutine(PlatformSaveSystem.LoadAsyncRoutine("slot1"));
After loading:
- All saved values are restored
- All
OnAfterLoad()callbacks run - Your game objects update automatically
5. FAQ
Do I need to register components?
No. Any script with ISaveComponent is detected automatically.
Do I need special folders?
No. The system uses the correct location for your platform.
Does saving freeze the game?
No — async saving runs off the main thread.
Can I save positions and rotations?
Yes — the system supports all Unity vector types.
6. Example: Saving Player Transform
public class PlayerTransformSave : MonoBehaviour, ISaveComponent
{
public string SaveKey => "PlayerTransform";
[SaveField] public Vector3 savedPosition;
[SaveField] public Quaternion savedRotation;
public void OnBeforeSave()
{
savedPosition = transform.position;
savedRotation = transform.rotation;
}
public void OnAfterLoad()
{
transform.position = savedPosition;
transform.rotation = savedRotation;
}
}
7. Example: Saving Inventory
public class InventorySave : MonoBehaviour, ISaveComponent
{
public string SaveKey => "Inventory";
[SaveField] public List<string> items;
public void OnBeforeSave() { }
public void OnAfterLoad() { }
}
8. Platform Support
- Windows / Mac / Linux – Full async support
- Android / iOS – Async safe with mobile fallback
- PS4/PS5/Xbox/Switch – Safe console save operations
- WebGL – Uses PlayerPrefs (browser-safe)
9. Best Practices
- Keep
SaveKeyvalues short and unique. - Only mark important fields with
[SaveField]. - Use
OnBeforeSave()for data gathering. - Use
OnAfterLoad()for applying restored values.