t1k:unity:editor:scene
| Field | Value |
|---|---|
| Module | editor |
| Version | 3.50.7 |
| Effort | medium |
| Tools | — |
Keywords: baker, onvalidate, prefab wiring, scene management, subscene, unity scene hierarchy
How to invoke
Section titled “How to invoke”/t1k:unity:editor:scene[demo-name] [--rebuild|--prefabs|--trees|--cache]GameKit Scene — Scene Setup Workflow
Section titled “GameKit Scene — Scene Setup Workflow”Automate the 5-step scene setup pipeline via t1k unity menu (Editor open).
/t1k:unity:editor:scene BattleDemo2D # Full rebuild/t1k:unity:editor:scene --prefabs # Only step 1/t1k:unity:editor:scene --cache # Only clear entity cacheWorkflow
Section titled “Workflow”Step 1: Create Unit Prefabs → t1k unity menu "Tools/{Demo}/Create Unit Prefabs"Step 2: Build BDP Trees → t1k unity menu "Tools/{Demo}/Build Behavior Trees"Step 3: Setup Scene → t1k unity menu "Tools/{Demo}/Setup Scene"Step 4: Clear Entity Cache → t1k unity menu "Tools/{Demo}/Clear Entity Scene Cache" — see "Safe entity-cache clear" belowStep 5: Verify Compilation → t1k unity recompile (errors come back in data.errors)Safe entity-cache clear (Blocker — destructive op safety)
Section titled “Safe entity-cache clear (Blocker — destructive op safety)”Step 4 historically used raw rm -rf Library/EntityScenes/. Do NOT recommend that. Reasons:
- Wrong CWD (e.g., shell launched from a parent of the Unity project) silently destroys the wrong directory.
- No backup — if something goes wrong mid-bake, the only recovery is
git checkoutof the entireLibrary/(often gitignored). - Bypasses Unity’s editor lock; deleting
Library/EntityScenes/while Unity is open can corrupt the project asset database.
Correct procedure (always):
- Verify CWD is the Unity project root:
[ -d ProjectSettings ] && [ -d Assets ] || { echo "Not a Unity project root"; exit 1; } - Close Unity first (or use the editor menu item below — Unity handles its own locks).
- Prefer the editor menu:
t1k unity menu "Tools/{Demo}/Clear Entity Scene Cache"— the project ships a guarded utility for exactly this. CLI fallback only when no editor session is available. - CLI fallback (only when Unity is closed AND CWD verified):
mv Library/EntityScenes Library/EntityScenes.bak.$(date +%s)— rename, don’t delete. Sweep backups manually after confirming a clean rebuild.
If a brief t1k-unity-dots-core-environment hands to t1k-unity-base-developer (the agent that now
executes this procedure, P30 agent-split program — environment holds no Bash/Edit itself)
still emits raw rm -rf, treat it as a bug and patch the brief — never propagate the unsafe
pattern.
Demo Menu Paths
Section titled “Demo Menu Paths”| Demo | Menu Path Prefix |
|---|---|
| BattleDemo | Tools/BattleDemo/ |
| BattleDemo2D | Tools/BattleDemo2D/ |
| BattleDemoIso | Tools/BattleDemoIso/ |
| BattleDemoSideView | Tools/BattleDemoSideView/ |
| BackpackCrawler | Tools/BackpackCrawler/ |
| InventoryDemo | Tools/InventoryDemo/ |
Scene setup is THREE steps — wire the prefab refs (Bug C/D safeguards)
Section titled “Scene setup is THREE steps — wire the prefab refs (Bug C/D safeguards)”Create All Prefabs + Setup Scene does NOT auto-populate [SerializeField] GameObject slots on authoring components. Without the wiring step, the SubScene bakes silently with Entity.Null prefabs and the Game view is empty. Apply BOTH safeguards on every new SubScene authoring with a prefab field:
OnValidate()warning on the authoring class (editor-only, skip during Play).- EditMode wiring test (
SerializedObject+FindProperty) asserting every slot is wired in the SubScene asset.
Full recipe + triage checklist: see references/troubleshooting.md → “Silent prefab-wiring + invisible-baker regressions (Bug C / Bug D, 2026-05-18)”.
Auto-Detection
Section titled “Auto-Detection”If no demo specified, detect from recent git changes or CWD.
Agent: t1k-unity-dots-core-environment (judgment) briefs t1k-unity-base-developer (execution)
Section titled “Agent: t1k-unity-dots-core-environment (judgment) briefs t1k-unity-base-developer (execution)”t1k-unity-dots-core-environment owns the scene-composition decisions this skill documents; it
holds no Edit/Bash/Editor write tool (P30, agent-split program) and briefs
t1k-unity-base-developer — spawned natively, not routed — to run the actual editor menu items and
CLI commands above.
References
Section titled “References”references/demo-detection.mdreferences/troubleshooting.md