Introduction
PersistKit saves and loads a game's data in Unity — one line for a value, one component for a scene object, no configuration and no surprise failures.
What PersistKit is#
PersistKit is a save and load package for Unity. One line saves a value, the same line in reverse loads it:
Persist.Save(class="tok-str">"score", 1500);
int score = Persist.Load(class="tok-str">"score", 0);There is no manager object to add, no setup step, and no configuration file to write before the first save. A player who has never played before gets the default you pass to Load, so there is never a null check to write and never an error on a first run.
It is also a package you can keep using as your game grows: named save slots, rotating backups, a recovery ladder for damaged files, optional encryption, references to objects and assets, the objects a game spawned from prefabs while it ran, cloud copies of a save, and migrations for a save written by an older build of your game.
The two ways in#
Available One line of code. Persist.Save / Persist.Load handle numbers, text, booleans, enums, Unity value types, your own [Serializable] classes and structs, and the collections built from them.
Available No code at all. Add PersistKit Behaviour to an object, tick the parts that should come back, and press Play. The Inspector lists each component's fields with a Save column and a Load column, so a value can be written without ever being overwritten, or read from an older save without being rewritten.
What it refuses to do#
- It never silently loses a value. A type it cannot store is refused, with a code, not written as nothing.
- It never silently returns the wrong thing. A missing key gives you your default; a damaged file is reported with the code for what was wrong and which file was used instead.
- It never overwrites a save it cannot read. A file from a newer build is refused, and the file is left as it is.
- It never guesses during a migration. A save with no migration covering its version is refused rather than read as if it were the current shape.
Where the claims on this site come from#
Every capability carries a status, and each one means exactly one thing:
Available in the package and enforced by tests · Verified exercised and passing in a named environment · Adapter required the package ships the contract and you supply the service · Roadmap planned, not shipped · Not verified reasoned about, never run · Not supported deliberately out of scope, with the reason stated
The platforms and limitations page says what has actually been run and where. The error codes page is the catalogue every message points at.
Where to go next#
- Install it — one folder, or the Package Manager.
- Save something in five minutes.
- Save a scene object without writing code.
- Let the game save itself, or give it a ready-made save menu.
- Look inside a save when you want to know what is really in the file.
Something wrong on this page? Every page here describes behaviour that is checked in the repository. If a page and the package disagree, the package wins.
Report a documentation problem · Error codes · Platforms and limitations