A save system for Unity. Mark a class with one attribute and a source generator writes its save code at compile time, so no reflection runs at load. Encrypted and signed by default.Stasis does not render anything, so it has no render pipeline dependency. It works with Built-in, URP and HDRP. The demo scenes use standard primitives and swap any unsupported shader on load, so they render correctly in any pipeline. Saved material state stores the shader by name, and falls back with a diagnostic if it is missing in the target project.Stasis Save SystemStasis saves and restores the state of a Unity game. It generates its save code at compile time instead of reading your fields with reflection at runtime, and it encrypts and signs every file by default.Making something saveableThere are two routes and you can mix them freely.Add the Stasis Identity and Stasis Common State Saveable components to a GameObject, tick what you want kept, and it survives a restart. No code at all. Transform, active state, layer, tag, renderers, colliders, rigidbodies, animator, audio and child transforms are all available.For your own data, mark a class with [SaveSlot] and make it partial. A Roslyn source generator writes the save and load methods while you compile. Every member is saved unless you exclude it, private ones included. Use [StasisIgnore] to skip one, [SaveMe] to save it under a different key, and [PreviouslySavedAs] when you rename it later. It works on plain C# classes as well as MonoBehaviours.Is it suitable for my genre?Stasis is not built around any one genre. It saves whatever your components hold, so it fits an RPG with a large inventory, a survival game with a persistent world, a roguelike storing run state, a mobile game that has to save the moment the player is interrupted, or a puzzle game keeping level progress.Larger projects have more to work with. A scene can be split into partitions and saved or loaded a region at a time. Split chunk storage rewrites only the chunks whose contents actually changed. Delta saves write what moved since the last full write, and slots can be preloaded off the main thread.How customizable is it?Full C# source is included. The core is not a DLL, so you can read it, debug into it and change it.One settings asset controls the serialization profile, compression, encryption, signing, backup count, autosave and platform behaviour. Beyond that, ISaveStorage lets you replace the storage backend entirely, IStasisTypeHandler adds support for your own types, and IStasisDiagnostics routes every warning and error into your own telemetry instead of the console.Keeping player saves workingSaves are written transactionally, so a crash partway through cannot destroy the file that was already there. Backups rotate on every write and a failed load falls back to them automatically, reporting which generation it used.When you change your data after shipping, [PreviouslySavedAs] handles a renamed field and a migration bootstrap handles whole document restructuring, applied in order from whatever version wrote the save. Every save records a schema fingerprint, and the Schema Diff window compares a save against the code you have now.Editor toolsSave Inspector, which opens any save file and shows its contents whatever the format, compression or encryption. Setup Wizard and Auto Setup. Repair Tool. Key Rotation, which re-encrypts existing saves so changing a key does not strand your players. Schema Diff. Diagnostics. link.xml generation for IL2CPP. Audits for hierarchy drift, reflection fallback and shader dependencies.A ready made slot menu, save toast and loading overlay are included, and Create Save UI builds them into your scene for you.CompatibilityUnity 6000.0 or newer. Requires the uGUI package, which every standard Unity template already includes. Works with Built-in, URP and HDRP. Optional integrations with Timeline, Cinemachine, Visual Effect Graph, Visual Scripting and Addressables compile only when those packages are present.DemosFour demo scenes are included, from a two minute first save through to a partitioned streaming world with save timings and a compression benchmark. DocumentationA 26 page PDF manual covers the whole system.Join the Discord for any live feedback or bug reports.Authoring[SaveSlot] attribute drives a Roslyn source generator that writes the ISaveable implementation at compile timeEvery member saved by default, private ones included, controlled with [StasisIgnore], [StasisInclude], [SaveMe] and [StasisRestoreOrder]Works on plain C# classes as well as MonoBehavioursStasis Common State Saveable saves transform, scale, active state, layer, tag, renderer, collider, rigidbody, animator, audio and child transform state with no codeStasis Identity gives an object a stable GUID so its data returns to it after a restartISaveable for hand written logic, IAsyncSaveable for work that should not block a frameIStasisTypeHandler registers your own typesSpawnRegistry recreates runtime instantiated objects on loadData coveragePrimitives, every common Unity math type, AnimationCurve, Gradient, Texture2D, DateTime, Guid, collections and nested sectionsLayer masks stored by name, so they survive a layer reorderAPIAsync SaveAsync and LoadAsync, with Unity Awaitable variants and synchronous formsStatic Stasis class for single values with no scene setup: Save, Load, KeyExists, DeleteKey, DeleteAll, RestoreBackupEvents for every stage: OnSaveBegan, OnSaveCompleted, OnLoadBegan, OnLoadCompleted, OnError, OnRecoveryAttemptedMulti slot, with slot names that may contain a forward slash to group saves per userAutosave on interval, application pause, focus loss and quitFile format and securityAES-256-CBC with a cryptographically random IV per saveHMAC-SHA256 computed over the encrypted payload and verified before decryption, using a constant time comparisonCompress, then encrypt, then sign, so a modified byte fails verification before anything is decryptedKey rotation utility re-encrypts existing saves under a new keyLZ4, GZip and Zstandard compression, with small payloads left uncompressedThree serialization profiles: BinaryFast by default, BinaryStandard, and Json for debuggingBuild validator fails a release build while the JSON debug override is onReliabilityTransactional writes: a save is staged and moved into placeRotating backup generations with automatic restore after a failed load, reporting which generation was usedTryRecoverSlotAsync for explicit recoveryCrash recovery journalingSlot metadata in a sidecar file, so listing slots reads no save fileScalePartitioned saves, with regions saved or loaded independently and loaded in dependency orderSplit chunk storage rewrites only the chunks whose contents changedDelta saves and slot preloadingMigration[PreviouslySavedAs] for a renamed member, MigrationMap for key remapping, and a migration bootstrap for whole document upgrades applied in orderSchema fingerprint recorded in every save, with a Schema Diff window comparing a save against current codeEditor toolsSave Inspector, Setup Wizard, Auto Setup, Repair Tool, Key Rotation, Schema Diff, Diagnostics, Create Save UIlink.xml generation for IL2CPPAudits for hierarchy drift, reflection fallback and shader dependenciesUISlot menu with save, load, delete, duplicate and restore per slotSave toast and loading overlay, and a controller that connects save events to UI with no codeDiagnosticsOver 70 structured event codes carrying severity, slot, operation, duration and payload sizeAssign an IStasisDiagnostics implementation to route them into your own telemetryPlatforms and integrationsDesktop, mobile and WebGL, with IndexedDB and a storage budget warning on WebGLDeferred saves on mobile pause and focus lossISaveStorage and a storage override for custom backends, including platform native save containersTimeline, Cinemachine 2 and 3, Visual Effect Graph and Visual Scripting, each compiled only when the matching package is presentAddressables detected automatically for asset referencesIncludedFull C# source. The core is not a compiled DLLFour demo scenes and a 26 page PDF manualUnity 6000.0 or newer. Requires the uGUI package, which every standard Unity template includes


