Unity 6.6 · v0.2.2 beta

Your Unity save system is two lines of code.

Alkibit Serialization writes a live GameObject tree — every child, every component, every reference between them — to JSON, then rebuilds it exactly. 79 built-in component types. No per-component save code. No null references after load.

Literally: player.Serialize() on the way out, data.Load() on the way back. Everything else on this page is detail you only reach for when you need it.

Free while it is in beta. $20 on the Unity Asset Store at launch.

Hierarchy
  • Player
    • Body
    • Weapon
      target → Enemy_04
player.Serialize()
save.json
{ "version": 220, "rootIds": ["KHZ12"], "objects": [{ "key": "KHZ12", "value": { "name": "Player", "components": [ … ] } }] }
data.Load()
Hierarchy
  • Player
    • Body
    • Weapon
      target → Enemy_04

Same tree. Same reference. Still pointing at Enemy_04.

79

Unity component types covered out of the box

3-pass

Create, populate, activate — in that order

23%

Of the minified payload size, gzipped

2 suites

EditMode and PlayMode tests ship with the package

6.6+

Unity 6000.6 and newer

The cost of not having this

You can write this yourself. Here is the bill.

Every team that ships a save system writes one first. It arrives in four instalments, and only the first one is on the schedule.

Month one

Writing it

A Rigidbody2D alone carries velocity, angular velocity, mass, drag, gravity scale, body type, collision detection, interpolation and constraints. That is one component. Your game has dozens. You write the save half, then the load half, then you do it again for the next one.

Every sprint

Keeping it current

Add a field to a MonoBehaviour and nothing tells you the save format is now stale. Old saves keep loading, quietly, with that field at its default. You find out from a player.

Ship week

The null references

Cross-object references are the part a hand-rolled system gets wrong. Which enemy am I targeting, the material on a renderer, a joint's connected body. Rebuild in the wrong order and half your pointers come back null. It reproduces once in twenty loads, which is the worst rate there is to debug.

After launch

The Awake() problem

Fill a component's fields after its GameObject is already active and Awake and OnEnable have run — on default values. Health bars initialised to zero. State machines that started in the wrong state. This is the one that ships.

The arithmetic

79 component types is 79 pieces of save code you would otherwise write, test and carry for the life of the project — plus the reference resolver underneath them, which is the part that actually bites.

This package is $20 at launch. Work out what an hour of your time costs, and the rest is arithmetic.

How it works

Three calls. Here is what each one actually does.

No setup step, no attributes to sprinkle through your classes, no registration file to keep in sync. Point it at a GameObject.

Serialize

Hand it a GameObject. It walks the whole tree — every child, every component, every field Unity itself would serialize — and writes one flat JSON document.

References between objects inside that tree become ids, so Weapon.target still points at the same enemy on the way back out.

SaveGame.csC#
using Alkibit.Serialization;

HierarchyData data = player.Serialize();

Store it anywhere

What comes out is plain, readable JSON. Write it to disk, put it in PlayerPrefs, send it down a socket. It is a string.

If size matters, one call gzips it to roughly a quarter. FromJson detects the form on the way back in, so a load never has to know which one it was handed.

SaveGame.csC#
File.WriteAllText(path, data.ToJson());

// or about a quarter of the size
string packed = PayloadCompression
    .GZipCompressToBase64(data.ToJson());

Rebuild

Load creates every object first, fills every field second, and activates third.

That order is the whole trick. By the time a component's Awake() runs, its data is already in place — and every reference has something real to point at.

LoadGame.csC#
HierarchyData data = SerializationJson
    .FromJson(json);

GameObject player = data.Load();

Coverage

79 component types, covered out of the box

Not reflected over and hoped for — each of these has a serializer that knows what the component actually holds. Your own MonoBehaviours are covered by a reflection fallback that needs no setup at all.

Transform

Transform, RectTransform.

Physics 2D

Rigidbody2D, every Collider2D, every Joint2D, and the effectors.

Physics 3D

Rigidbody, box / capsule / sphere / mesh colliders, CharacterController, joints.

Rendering

MeshRenderer, MeshFilter, SpriteRenderer, LineRenderer, TrailRenderer, Camera, Light.

UI and text

Button, Toggle, Slider, InputField, ScrollRect, layout groups, Canvas, Dropdown, TextMeshPro.

Audio

AudioSource and every audio filter.

Tilemaps

Grid, Tilemap including tile placement, TilemapRenderer.

Animation and effects

Animator and ParticleSystem — both partial. See exactly how far.

What survives the round trip

Cross-object references — one GameObject pointing at another

Cross-component references — a field on A pointing at a component on B

Asset references — materials, textures, audio clips, prefabs

Arrays and Lists of any of the above

Nested [Serializable] classes — four levels deep, with reference cycles detected and named

Scene objects outside the payload — by hierarchy path, or by a rename-proof id

Before you buy

What it does not do

Every asset page tells you what it handles. This is the other list, so you find out now rather than three weeks into a project.

ParticleSystem Partial

Main, emission including bursts, shape, velocity / limit-velocity / force / colour / size / rotation over lifetime, and noise all round-trip.

Collision, triggers, sub-emitters, texture sheet animation, trails, lights, custom data, external forces and inherit velocity do not — they come back at the freshly-created component's defaults.

Animator Partial

Controller and avatar, eight scalar properties, parameter values, layer weights, and the current state per layer with its normalized time.

In-progress transitions and blend-tree evaluation state have no runtime API to read, so a restored Animator resumes from the current state rather than mid-crossfade.

UnityEvent Partial

Persistent calls configured in the Inspector round-trip, but only no-argument ones. A call carrying an int, float, string or object argument is skipped with a warning that names it.

A listener added at runtime through AddListener is invisible to Unity's public API, so it cannot be captured, or even warned about.

Navigation, Terrain, Timeline, XR No serializer yet

NavMeshAgent and the rest of the navigation components, Terrain, Cloth, VideoPlayer, Timeline's PlayableDirector, WheelCollider, SkinnedMeshRenderer, UIDocument, and the XR component families.

Nothing special-cases them out. Register a ComponentSerializer<T> and they work like anything else.

Untrusted payloads

A save file is yours. A network payload is someone else's.

Loading names a component by type and calls AddComponent on whatever resolves, which fires that type's Awake. For a payload you did not write, that is a real surface. So it is gated.

ComponentTypeFilter allow-lists the types a load may instantiate. PersistentCallFilter allow-lists the methods a restored UnityEvent may bind. MaxObjectCount and MaxDepth refuse an over-budget payload before anything is created, so nothing half-built is left in your scene.

Both filters are per-call and lifted on the way out, even if the load throws.

NetworkSpawn.csC#
LoadOptions options = new()
{
    ComponentTypeFilter = t => Allowed.Contains(t),
    PersistentCallFilter = (target, method) =>
        method == "OnNetworkClick",

    MaxObjectCount = 500,
    MaxDepth = 32,
};

// empty if the payload is over budget -
// nothing partial reaches the scene
List<GameObject> loaded =
    untrusted.LoadAll(null, options);

What people build with it

Four jobs, one API

Save and load

Persist a player, a base, or a whole level between sessions — including everything spawned at runtime.

Deep clone

original.Serialize().Load(). One line, hierarchy and references and all.

Level and base editors

Let players build something, then write it back out as readable JSON they can share.

Networking

Replicate spawned hierarchies to clients, with the untrusted-payload gates switched on.

Questions

The things developers ask first

Which Unity versions does it support?

Unity 6000.6 (6.6) and newer. The payload shape leans on Unity 6.6's built-in Dictionary<,> serialization, so earlier versions will not compile it.

Do I get the source?

Yes. Every serializer ships as readable C# with no compiled DLLs, so you can step through the load path in your own debugger and register your own serializers over the built-in ones.

Will it handle my own MonoBehaviours?

Yes, with no setup. The reflection fallback covers exactly what Unity itself serializes: public instance fields, plus private ones marked [SerializeField], minus anything marked [NonSerialized] — across the whole inheritance chain, including a private field declared on a base class.

Auto-properties are the one catch: a { get; private set; } is not a field, so mark it [field: SerializeField] and it is carried.

Is it fast enough to call at runtime?

Version 0.2.2 shipped a pass over the serialize and load hot path — cached type names, allocation-free struct writers, per-type field caches.

For a type you serialize constantly, a custom serializer runs roughly two to three times faster than the reflection fallback. For large payloads, LoadCoroutine and LoadAllCoroutine spread the same three passes across frames on a millisecond budget you set.

What about Addressables or asset bundles?

Asset references resolve through AssetRegistry first, then through any IAssetResolver you add. Point one at your Addressables catalog or bundle table and it slots in ahead of or behind the built-in Resources scan, whichever you prefer.

It says beta. Is it safe to build on?

The payload format is stable and versioned — the C# API is what may still move between releases. EditMode and PlayMode test suites ship with the package, including a golden fixture that pins the wire format so a payload written today still loads tomorrow.

Every breaking change is written up in the changelog, which ships with the package.

What does it cost?

Free while it is in beta — you get the package and the docs for joining the list. $20 on the Unity Asset Store at launch.

Early access

Get the beta build

Free while it is in beta. You get the package, the full documentation, and one email when it lands on the Asset Store.

  • The full package, plus both sample scenes
  • Documentation and the full API reference
  • One email at launch. Nothing else, ever.

Join the beta list

Takes about fifteen seconds.

No newsletter. Unsubscribe is a reply saying so.