How to use
How to use
1) Create an empty GameObject (or use existing one) and add the SaveLoadManager component.
2) Add SaveObj to every GameObject that needs to be saved (those that change during play).
Note: Runtime-created GameObjects are supported
3) If a GameObject with SaveObj has custom scripts, mark the fields you want to save with the [Saveable] attribute. (See section "Saveable attribute")
4) Unity built-in components (Rigibody, SpriteRenderer, etc.) are handled automatically via the ComponentFields asset.
5) In the SaveObj inspector, select which fields to save or ignore.
6) The scene is ready. Add using SaveKit; at the top of your script, then call SaveLoadManager.Save() / Load() from any script or UI button.
Note: Save Kit uses Newtonsoft JSON. If you see a console error, install it via:
Tools --> Save Kit --> Install Newtonsoft JSON.
The SaveLoadManager component
The SaveObj component
Example how to save & load
(This section explains each key property in detail.)
Main manager, placed once in the scene. Handles all Save/Load calls.
Component attached to GameObejcts that need to be saved and loaded. In the inspector, you can select which fields to be save/ignore.
Note: Runtime-created GameObjects are supported.
Mark a field in a custom script with [Saveable] to make it persist.
Both public and private fields are supported, as SaveKit uses reflection.
Note: see the supported data types section.
Save Kit natively serializes:
Primitives: int, float, double, bool, string, enum
Unity structs: Vector2, Vector3, Vector2Int, Vector3Int, Quaternion, Color, Color32, Rect
Unity objects: Sprite, Texture2D, Mesh, Material
Collections: T[], and List<T>
References to Unity classes
References to custom classes
References to GameObject/Unity Components
Implement OnLoaded() to run code right after a Load.
Base name for the save file. Extension is auto-set (.json or .sav).
Number of save slots per save file. (see page "Save Slots")
Default: false
Enable AES-256-CBC encryption. Key derived via PBKDF2 (100,000 iterations, SHA-256)
Password for key derivation. Change before shipping.
Default: true
Appends a CRC-32 checksum. Load aborts if the file is corrupted.
Default: false
GZip-compress the file after encryption. Reduces file size significantly for large saves.
Default: true
Write to a temp file, then rename. Prevents data loss on crash or power failure.
If you don`t need multiple slots or groups, simply use Save() / Load()
The full pipeline on Save:
JSON - [CRC-32 wrapper] --> [AES-256-CBC] --> [GZip] --> [Atomic rename] --> Disk
On Load the pipeline is reversed automatically.
Key derivation: PBKDF2 with SHA-256, 100 000 iterations.
Mode: CBC with a fresh random IV per save.
IV storage: prepended to the ciphertext (first 16 bytes).
File extension: .sav when encrypted, .json when plain.
A CRC-32 digest is computed on the raw JSON and stored inside a thin wrapper object. On load, the digest is recomputed and compared. If they differ, loading is aborted and an error is logged - preventing silent data corruption.
Applied after encryption (if enabled). Typical save files compress to 20-40 % of their original size. Recommended for large scenes with many objects. (300 GameObjects + with the SaveObj component)
The file is first written to save _slot0.json.tmp, then the original is deleted and the temp file is renamed. If the process is killed mid-write, the original file is untouched.
To open: Tools --> Save Kit --> Save File Browser
This displays all stored save files and their details.
To open: Tools --> Save Kit --> Component Fiels Editor
Supported Unity Components & Fields
A list of commonly used built-in Unity components and their fields.
We`ve included the most widely used components, but some rare ones may be missing. If needed, you can add custom components and fields directly in the editor by entering their exact names.
Note: Component and field names must match their code definitions exactly.
If the list is empty, reset it via Tools --> Save Kit --> Set Default Component Data. Otherwise, Unity components won`t be saved for GameObjects with the SaveObj component