Skip to content

t1k:unity:editor:scene

FieldValue
Moduleeditor
Version3.50.7
Effortmedium
Tools—

Keywords: baker, onvalidate, prefab wiring, scene management, subscene, unity scene hierarchy

/t1k:unity:editor:scene
[demo-name] [--rebuild|--prefabs|--trees|--cache]

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 cache
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" below
Step 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 checkout of the entire Library/ (often gitignored).
  • Bypasses Unity’s editor lock; deleting Library/EntityScenes/ while Unity is open can corrupt the project asset database.

Correct procedure (always):

  1. Verify CWD is the Unity project root: [ -d ProjectSettings ] && [ -d Assets ] || { echo "Not a Unity project root"; exit 1; }
  2. Close Unity first (or use the editor menu item below — Unity handles its own locks).
  3. 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.
  4. 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.

DemoMenu Path Prefix
BattleDemoTools/BattleDemo/
BattleDemo2DTools/BattleDemo2D/
BattleDemoIsoTools/BattleDemoIso/
BattleDemoSideViewTools/BattleDemoSideView/
BackpackCrawlerTools/BackpackCrawler/
InventoryDemoTools/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:

  1. OnValidate() warning on the authoring class (editor-only, skip during Play).
  2. 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)”.

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/demo-detection.md
  • references/troubleshooting.md