Samples

The four samples import from Package Manager → NexusForge Persistence → Samples. Each has its own assembly definition, so it compiles cleanly in a project of any size and can be deleted without leaving dangling references.

SampleShowsAssembly references it needs
01_BasicSaveLoadSave, load, autosave and flush on pauseCore, Unity, Serializers.Newtonsoft
02_CloudSyncA provider, an offline queue and a preserved conflictCore, Unity, Serializers.Newtonsoft
03_MigrationAndVersioningSchema 1 → 2 through a registered migration, unknown members preservedCore, Unity, Serializers.Newtonsoft
04_PersistentObjectsAndCheckpointsStable identities and rotating recovery pointsCore, Unity, Serializers.Newtonsoft

01 — Basic save and load#

The shortest useful example: a model, a component that saves it on disable and on pause, autosave with a debounce, and a checkpoint the player can fall back to. Start here; everything else builds on it.

02 — Cloud synchronisation#

A full sync against the in-memory FakeCloudTransport: upload, download, an offline queue that survives a restart, and a conflict that is preserved rather than resolved silently. It is the clearest way to see what the framework does above your transport, and what it expects your transport to do.

03 — Migration and versioning#

Writes a schema 1 save, then loads it as schema 2 through a registered migration, and shows an unknown member surviving the round trip intact. The migration is code, registered at initialisation, exactly as a shipping project would do it.

04 — Persistent objects and checkpoints#

Objects that must survive a scene edit, with persistent identities and the identity scan that finds missing or duplicate ids; plus rotating checkpoints that a player can return to. It is the sample to read before making a world that can be re-entered.

Running them safely#

Each sample folder contains its own README.md describing what it demonstrates, what to press and what to expect, and the code is documented in place. Samples are compiled as part of the package's own verification, so one cannot rot unnoticed.

Next#