Appearance
Interface: SaveOptions
Properties
| Property | Type | Description |
|---|---|---|
resources? | Resource<any>[] | Resources written to save slots (game progress: level, score, inventory). |
traits? | (Trait | Relation<any>)[] | Entities to save: every entity with at least one of these traits, with these traits' values. Loading replaces those entities. Non-JSON traits (MeshRef) can't be saved: rebuild visuals on Loaded, or with a system over [IsCoin, Not(MeshRef)]. Relations listed here are relinked between saved entities. |
persist? | Resource<any>[] | Resources kept across sessions automatically (settings, high scores): loaded at startup, saved when they change. |
key? | string | Storage key prefix, so games on one origin don't collide. Default 'kiln'. |
storage? | SaveStorage | Default: localStorage in the browser, memory elsewhere. |