Save System Designer Guide

How to use the cross-platform, async-enabled save system

Overview

This Save System is designed for non-programmers and offers:

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() { }
}

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"));
Async saving prevents gameplay hiccups and is fully safe.

4. Loading the Game

Synchronous load:

PlatformSaveSystem.Load("slot1");

Async load:

await PlatformSaveSystem.LoadAsync("slot1");

Coroutine load:

StartCoroutine(PlatformSaveSystem.LoadAsyncRoutine("slot1"));

After loading:

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

Designers do not have to change anything — the system adapts automatically.

9. Best Practices