Scenario Unity architecture
For structuring Unity 6.3 C# code: ScriptableObject data vs runtime state, events and services, inventory, health, save and load.
In detail
Use when structuring Unity 6.3 C# code: ScriptableObject data vs runtime state, events and services, inventory, health, save and load, Input System actions and key rebinding, async with Awaitable, assembly definitions, Enter Play Mode and domain reload, .meta files, Git, Smart Merge and LFS. Also when 'my save works in the Editor but not in the build', statics keep values on the second Play, events fire twice or never, an await runs after its object died, rebinds are lost on relaunch, a renamed class loses its data, a scene merge breaks.
Safety check
- Script runs other programs or code: scripts/ut_arch.py line 40
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: scenario-unity-architecture
description: "Use when structuring Unity 6.3 C# code: ScriptableObject data vs runtime state, events and services, inventory, health, save and load, Input System actions and key rebinding, async with Awaitable, assembly definitions, Enter Play Mode and domain reload, .meta files, Git, Smart Merge and LFS. Also when 'my save works in the Editor but not in the build', statics keep values on the second Play, events fire twice or never, an await runs after its object died, rebinds are lost on relaunch, a renamed class loses its data, a scene merge breaks."
license: MIT
---
# Unity architecture (gameplay programmer / architect)
Expert architecture in Unity is judged by what survives the edges: the second Play session, a
destroyed object mid-await, a relaunch of the built player, a class rename, a merge of two branches,
a prefab dropped into an empty scene. Data lives in assets, state lives in plain C# and files,
systems talk through events they do not own, and every claim is pinned by a test the agent can run
without a mouse. Target: Unity 6000.3.21f1, Input System 1.20.0, Test Framework 1.6.0, macOS. If a
sibling skill named here is missing from your available skills, load it with `skill_get` (Scenario
MCP) or ask the user to install it (https://github.com/scenario-labs/skills#install); unattended,
proceed from tool schemas and flag the gap.
**REQUIRED BACKGROUND:** scenario-unity-expert (channels, review loop, 6.3 traps). Toolkit:
`ut_env`, `ut_run`, `ut_live` plus this skill's [`scripts/ut_arch.py`](scripts/ut_arch.py),
[`scripts/AgentKit/Architecture/`](scripts/AgentKit/Architecture/) jobs and
[`scripts/templates/`](scripts/templates/) (a tested Game.Core / Game.Runtime / Game.Editor / tests
layout).
**Status (2026-09-24):** every procedure ran in Unity 6000.3.21f1 on this Mac:
`tests/code/unity-architecture/run_all.sh --live` (results in
`archive/tests/unity-architecture/live_results.jsonl`).
## Stance (the expert delta)
1. **ScriptableObjects are definitions, never saves.** Play-mode writes to an SO persist in the
Editor and reset on every launch of a build (Code Monkey, 5a-ztc5gcFw [00:04:17]). Observed
sharper: the write lives only in Editor memory (`IsDirty` false, the `.asset` unchanged even
after `SaveAssets`), so a file hash never sees it; only an in-memory guard in the process that
plays does (`so_guard`, the prefab SO test). A macOS player run twice started from the baked
value while the save FILE carried over. Runtime modifiers apply to a struct copy (`config.Stats`,
Tarodev, tE1qH8OxO2Y [00:11:18]); live registries are runtime sets, never scene searches (Hipple,
raQ3iHhE_Kk [00:40:06]). Saves: versioned JSON of ids, atomic write, backup, migrations.
2. **Read Enter Play Mode before trusting any Play test.** With domain reload off (an option in 6.3,
the default for new 6.6 projects) a static counter read 2 and a static event had 2 subscribers on
the second Play (observed). Unregister static handlers on `ExitingPlayMode` (the Manual's best
...From scenario-labs's repository, MIT licence.
Related skills
-
Checked
Game Audio Mixing
Sets up game audio buses, volume sliders, music ducking and adaptive music for Godot, Unity or FMOD.
8/101 credit -
Checked
Game camera tuning
Builds and tunes follow, orbit and first person game cameras in Godot or Cinemachine so they stop jittering.
8/101 credit -
Checked
Game Enemy AI
Designs enemy AI with perception, pathfinding and steering so enemies chase fairly and never get stuck.
8/101 credit -
Checked
Game Loop and Timing
Makes movement, timers and physics behave the same at any frame rate in Unity, Godot, Bevy and web games.
7/101 credit -
Checked
Godot Game Testing
Writes and runs Godot tests with gdUnit4 or GUT, including scene tests and headless runs that report real results.
7/101 credit -
Checked
Game Security Review
Reviews Unity, Godot and Unreal code for cheats that hurt other players, purchase exploits and unsafe save files.
7/101 credit