01 · Engine & Environment
| Package | Version | Role |
|---|---|---|
| com.unity.cinemachine | 2.8.9 | Camera control and virtual cameras |
| com.unity.textmeshpro | 3.0.6 | High-quality text rendering |
| com.unity.timeline | 1.6.4 | Sequenced cutscenes and animations |
02 · Asset Inventory
Total Assets/ size: 50.3 MB. No third-party/vendor folders were detected by the walker. Special Unity folders present include TextMesh Pro/Resources and Joystick Pack/Scripts/Editor.
| Extension | Count | Notes |
|---|---|---|
| .asset | 559 | ScriptableObject data, settings, and configs |
| .png | 306 | Primary sprite and UI texture format |
| .prefab | 106 | Prefab library — 106 reusable GameObjects |
| .wav | 95 | Uncompressed audio — consider .ogg for build size |
| .cs | 56 | C# scripts — see Script Analysis section |
| .anim | 53 | Animation clips |
| .controller | 41 | Animator state machines |
| .unity | 38 | Scenes — 4 game scenes + TMP examples + vendor demos |
| .mat | 24 | Materials |
| .shader | 13 | Custom shaders |
| .ttf | 10 | Font assets |
| .jpg | 10 | Non-sprite textures |
| .txt / .json / .pdf | 13 | Documentation and data files |
| .mp3 | 1 | Mixed audio formats — standardize to .wav or .ogg |
95 .wav files and 1 .mp3 indicates inconsistent audio pipeline. For build-size optimization, consider converting background music to .ogg (good compression) and short SFX to .wav (low decode overhead). Mixing formats can complicate AudioMixer management.
03 · Scene Inventory
38 total scenes detected. The four game scenes are the targets for all active development. The remaining scenes are TextMesh Pro examples (to be excluded from build settings) and vendor/asset-pack demos (informational only).
Game Scenes — Active Development Targets
| Scene | Size | Objects | Lighting |
|---|---|---|---|
| Scenes/Level02.unity | 412.0 KB | ~88 | Baked |
| Scenes/Level01.unity | 358.9 KB | ~80 | Baked |
| Scenes/Menu.unity | 60.5 KB | ~41 | Baked |
| Scenes/Pass.unity | 30.3 KB | ~21 | Baked |
Vendor / Demo Scenes — Do Not Modify
| Scene | Size | Objects |
|---|---|---|
| Cainos/…/SC Demo Scene - Village Props.unity | 912.6 KB | ~239 |
| SunnyLand Artwork/Scenes/Demo_characters.unity | 371.3 KB | ~159 |
| TWD/FreeButtonSet/Scenes/SampleScene.unity | 180.4 KB | ~160 |
| Joystick Pack/Examples/Example Scene.unity | 123.0 KB | ~96 |
| TextMesh Pro/Examples & Extras/Scenes/* (25 scenes) | 6–270 KB each | 3–250 |
Ensure that all TextMesh Pro example scenes and vendor demo scenes are excluded from Build Settings. Including them will inflate build size significantly and may introduce unintended scene-load paths.
04 · Script Analysis
| Category | Count | Status |
|---|---|---|
| MonoBehaviours | 42 | Normal for project scale |
| ScriptableObjects | 0 | No SO-based architecture — data lives in scene hierarchies |
| Interfaces | 0 | No abstraction layer — tight coupling between systems |
| Assembly Definitions (.asmdef) | 0 | HIGH PRIORITY — create before any other refactor |
| Editor Scripts | 4 | Custom editor tooling (Joystick Pack) |
| Namespaces in Use | 2 | TMPro only — game scripts are unnamespaced |
The walker detected Observer/Event pattern usage. Without assembly definitions, these event subscriptions cross assembly boundaries invisibly — making it impossible to reason about compile-time dependencies. Create assembly definitions first to make these dependencies explicit before any further refactoring.
05 · Legacy / Deprecated API Hits
18 total legacy API calls detected across game scripts and TMP example scripts. The TMP example hits are low-priority (vendor code, not modified). The hits in your own scripts — particularly Menu.cs — should be addressed in Phase 2.
For Menu.cs: replace all GameObject.Find() calls with serialized [SerializeField] references set in the Inspector, or inject via a ServiceLocator / singleton manager. This eliminates string-based coupling and runtime search overhead. The Resources.Load hits in TMP example scripts are vendor code — do not modify them.
06 · Hardcoded Asset References
14 scripts contain hardcoded asset references that need migration to a ContentRegistry ScriptableObject or Addressables. The game scripts listed below are the priority targets. TMP example scripts are vendor code and should not be modified.
Game Scripts — Priority Migration Targets
| Script | Line | Reference | Action |
|---|---|---|---|
| Scripts/FirstDoor.cs | L7 | public GameObject enterDialog; | Migrate to ContentRegistry or [SerializeField] |
| Scripts/Caidan.cs | L9–11 | SheZhi, FanHui, MianBan | Three public refs — consolidate into a UI config SO |
| Scripts/PlayerCtrl.cs | L21 | public GameObject go; | Identify reference target and inject via Inspector |
TMP Vendor Scripts — Do Not Modify
The remaining 11 scripts with hardcoded references are all in TextMesh Pro/Examples & Extras/Scripts/. These are Unity-provided example scripts. They use Resources.Load to load fonts and materials at runtime. Do not modify these files. They will not affect your game build if the TMP example scenes are excluded from Build Settings.
07 · CLAUDE.md Constitution
Paste the following block into your root CLAUDE.md file. This gives Claude Code the architectural context it needs to assist safely — enforcing assembly boundaries, preventing vendor file modification, and gating refactor scope to one script per turn.
# Final Game project — Claude Code Constitution
## Tech Stack
- Unity 2021.3.32f1
- Render Pipeline: Built-in (Legacy)
- C# — .NET Standard 2.1
## Architecture State (pre-refactor)
- Observer/Event pattern detected
- NO Assembly Definitions — everything in default assembly
## Assembly Boundaries (to be created)
- Core.asmdef — no dependencies
- Gameplay.asmdef — depends on Core only
- UI.asmdef — depends on Core only
- Content/ — NO asmdef, assets only
## Critical Rules
1. NEVER modify files in ThirdParty/ or Plugins/
2. NEVER move files outside the Unity Editor window
3. NEVER create direct asset references in Gameplay/ or Core/
4. ALL asset access through ContentRegistry ScriptableObject
5. Stop and show diff after each file — wait for approval
6. Do not refactor more than one script per turn
## Do Not Touch
# (populate with specific vendor folders as identified)
## Refactor Phase
CURRENT: Audit complete — awaiting Phase 2 (Interface Generation)
08 · Suggested Refactor Priority
-
High
Create Assembly Definitions
No .asmdef files exist — the entire project compiles in a single default assembly. Creating
Core.asmdef,Gameplay.asmdef, andUI.asmdefbefore any other refactor is essential. Without boundaries, the Observer/Event dependencies are invisible to the compiler and impossible to reason about safely. This is the prerequisite for all subsequent phases. -
Medium
Update Legacy API Calls (18 hits)
Replace all
GameObject.Find()calls inMenu.cswith serialized Inspector references or a ServiceLocator pattern. TheResources.Loadhits in TMP example scripts are vendor code — do not touch. Focus only on the 5 hits in your own scripts. -
Medium
Migrate Hardcoded Asset References (14 scripts)
The 3 game scripts with public
GameObjectreferences (FirstDoor.cs,Caidan.cs,PlayerCtrl.cs) should be migrated to aContentRegistry ScriptableObjector promoted to[SerializeField]with Inspector assignment. TMP example scripts are not migration targets. -
Phase 3
Exclude Vendor Scenes from Build Settings
Remove all TextMesh Pro example scenes and asset-pack demo scenes from Build Settings before the next build. This will reduce build size and eliminate unintended scene-load paths.