Unity Project Walker · Automated Audit Report

Final Game Project — Architecture Audit

Generated 2026-04-02 · Unity 2021.3.32f1 · Built-in Render Pipeline · 56 C# scripts · 50.3 MB assets

Project: Final Game project
Path: /Users/bear/Downloads/YixinDu_CSYE7270_Final/
Phase: Audit Complete — Awaiting Phase 2

01 · Engine & Environment

Unity Version
2021.3.32f1
LTS release. Stable but approaching end of extended support window.
Render Pipeline
Built-in
Legacy pipeline. No URP/HDRP. Migration to URP would require shader audit.
Cinemachine
2.8.9
com.unity.cinemachine — camera control package.
TextMeshPro
3.0.6
com.unity.textmeshpro — current stable for Unity 2021 LTS.
Key Packages
PackageVersionRole
com.unity.cinemachine2.8.9Camera control and virtual cameras
com.unity.textmeshpro3.0.6High-quality text rendering
com.unity.timeline1.6.4Sequenced 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.

File Counts by Extension
ExtensionCountNotes
.asset559ScriptableObject data, settings, and configs
.png306Primary sprite and UI texture format
.prefab106Prefab library — 106 reusable GameObjects
.wav95Uncompressed audio — consider .ogg for build size
.cs56C# scripts — see Script Analysis section
.anim53Animation clips
.controller41Animator state machines
.unity38Scenes — 4 game scenes + TMP examples + vendor demos
.mat24Materials
.shader13Custom shaders
.ttf10Font assets
.jpg10Non-sprite textures
.txt / .json / .pdf13Documentation and data files
.mp31Mixed audio formats — standardize to .wav or .ogg
Audio Format Note

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

Core Game Scenes
SceneSizeObjectsLighting
Scenes/Level02.unity412.0 KB~88Baked
Scenes/Level01.unity358.9 KB~80Baked
Scenes/Menu.unity60.5 KB~41Baked
Scenes/Pass.unity30.3 KB~21Baked

Vendor / Demo Scenes — Do Not Modify

Asset Pack and TMP Example Scenes
SceneSizeObjects
Cainos/…/SC Demo Scene - Village Props.unity912.6 KB~239
SunnyLand Artwork/Scenes/Demo_characters.unity371.3 KB~159
TWD/FreeButtonSet/Scenes/SampleScene.unity180.4 KB~160
Joystick Pack/Examples/Example Scene.unity123.0 KB~96
TextMesh Pro/Examples & Extras/Scenes/* (25 scenes)6–270 KB each3–250
Build Settings Warning

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

Total C# Scripts
56
Across all folders including TMP examples.
MonoBehaviours
42
Component scripts attached to GameObjects.
Assembly .asmdef
0
No assembly boundaries. Everything in the default assembly.
Namespaces
2
TMPro and TMPro.Examples only. Game scripts lack namespaces.
Script Architecture Breakdown
CategoryCountStatus
MonoBehaviours42Normal for project scale
ScriptableObjects0No SO-based architecture — data lives in scene hierarchies
Interfaces0No abstraction layer — tight coupling between systems
Assembly Definitions (.asmdef)0HIGH PRIORITY — create before any other refactor
Editor Scripts4Custom editor tooling (Joystick Pack)
Namespaces in Use2TMPro only — game scripts are unnamespaced
Observer / Event Pattern Detected

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.

GameObject.Find(
⚠ Fragile — consider dependency injection or serialized references instead
Scripts/Menu.cs:19GameObject.Find( call
Scripts/Menu.cs:20GameObject.Find( call
Scripts/Menu.cs:24GameObject.Find( call
Scripts/Menu.cs:25GameObject.Find( call
Scripts/Menu.cs:29GameObject.Find( call
Resources.Load(
⚠ Prefer Addressables for runtime asset loading — Resources.Load blocks the main thread
TMP Examples (13+)Font and material loading via Resources.Load — vendor code, low priority
Refactor Strategy

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

Hardcoded Public GameObject References — Your Scripts
ScriptLineReferenceAction
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

Vendor Code — Informational Only

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.

CLAUDE.md — Root Constitution
# 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