Unity host & runs
The Unity-facing host is UnityGnosisEngine (Runtime/GnosisEngine/Adapters/Unity/UnityGnosisEngine.cs). It owns:
- Service list —
GnosisEngineServiceEntry[]configured in the inspector (service id, Permanent vs Ephemeral, and optional adapter binding). - Run state — e.g.
NotInRun,LoadingRun,Playing,Paused, plus an optional sub-state string for your game phase (RunSubState). - Lifecycle — Permanent services and adapters wake at
Awake; ephemeral ones are created when you start or load a run, and torn down when the run ends. - Asset registry —
UnityAssetRegistryfor resolving engine asset ids to Unity objects/prefabs.
Permanent vs Ephemeral (again)
| Lifetime | Exists when | Typical contents |
|---|---|---|
| Permanent | Whole session / app run | Configuration, settings, localization, UI shell, input routing |
| Ephemeral | Only inside an active run | Money, shop, boons, run seed, run-specific rules list |
If you are deciding where to put new data, ask: “Should this survive only until the player exits the run?” → Ephemeral. “Across menus and runs until save?” → Persistent branch (often written via services, not hand-edited every frame).
Debugging helpers
The host exposes context-menu actions to dump Persistent or Ephemeral JSON to the console and helpers to write a branch to disk—useful once you understand which keys your services use.
Gameplay input nuance
There is a short gameplay input suppress window after resume so the same binding (e.g. Submit / Hard Drop) does not double-fire through UI and game. If your game adds similar shared bindings, read the fields/tooltips on UnityGnosisEngine rather than fighting it ad hoc.
Next: Engine lifecycle for the pure GnosisEngine side.