The prototype ships without the Unity project bootstrapped. This file walks through what you do in the editor once you point Unity at
Games/Hearthwood/.
| Tool | Version |
|---|---|
| Unity Hub | latest |
| Unity Editor | 6 LTS (6000.x) — must match the package versions in Packages/manifest.json |
| WebGL Build Support module | optional, only for WebGL targets |
| Visual Studio / Rider | for C# editing (VSCode also works) |
If you don’t have Unity installed yet: this prototype is also viewable without Unity via
preview.html (double-click in any browser). Skip to the end of this doc for the
preview-only flow.
Games/Hearthwood/.manifest.json (~2-5 min).Assets/ScriptableObjects/):
Items/: 5 items (Coin, Health Potion, Iron Sword, Wood, Herb)Collectibles/: 3 collectibles (Herb, Wood, Coin) — each linked to a questNPCs/: Bron the Blacksmith, Mara the Innkeeper — each with default dialogue + offered questQuests/: Gather Wild Herbs, Deliver a Message, The Bandit ProblemDialogues/: Bron’s 3-node tree, Mara’s 3-node treeScenes/: Scene_Village reference (still need to author the actual scene below)Assets/Scenes/Village.unity.Scene_Village.asset → click Find Scene Asset then
Add to Build Settings to register the scene.Scene Root
├── Main Camera ← add PlayerCamera.cs
├── EventSystem ← (built-in) needed for UI hover/click
├── Directional Light
│
├── ─── System Singletons ───
├── GameManager ← GameManager.cs
├── InputManager ← InputManager.cs + PlayerInput component
│ └─ PlayerInput Actions Asset = Assets/Settings/HearthwoodInputActions.inputactions
│ └─ Default Map = "Player"
├── SceneController ← SceneController.cs (drop SceneData assets into Catalog)
├── AudioManager ← AudioManager.cs
├── FavorTokenSystem ← FavorTokenSystem.cs
├── ItemDatabase ← ItemDatabase.cs (auto-populates from Resources / FindObjectsOfTypeAll)
├── QuestSystem ← QuestSystem.cs
├── DialogueRunner ← DialogueRunner.cs
├── AmbientAudioManager ← AmbientAudioManager.cs (assign ambient clips)
├── InteractionAudio ← InteractionAudio.cs (assign SFX clips)
│
├── ─── World ───
├── Terrain / Ground Plane
├── Buildings (5+): Tavern, Blacksmith, Market, House A, House B
├── Props: trees, well, market stalls
├── NavMesh Surface ← bake before play
│
├── ─── Player ───
├── Player ← CharacterController + PlayerController3D.cs + HealthComponent + InventoryComponent + PlayerPersistence (auto-registers)
│ └─ Children: CombatController (sword hitbox), FootstepPlayer
│
├── ─── NPCs ───
├── NPC_Bron ← NPCController.cs + NavMeshAgent; assign NPCData = NPCs/NPC_Bron
├── NPC_Mara ← NPCController.cs + NavMeshAgent; assign NPCData = NPCs/NPC_Mara
│
├── ─── Collectibles ───
├── Herb_1..Herb_5 ← Collectible.cs + Collider (trigger); assign CollectibleData per
├── Wolf_1..Wolf_3 ← enemy placeholder (cube + HealthComponent); add to "Enemy" tag
│
└── ─── UI ───
└── Canvas (Screen Space - Overlay)
├── HUDController ← HUDController.cs (assign all TMP fields + HP bar fill)
├── DialoguePanel ← DialogueUI.cs (portrait + name + line + choices)
├── QuestLogPanel ← QuestLogUI.cs (active + completed scroll content)
├── PausePanel ← PauseMenuUI.cs (4 buttons)
├── InventoryPanel ← InventoryUI.cs (slot template + grid + tooltip)
├── InteractPromptUI ← InteractPromptUI.cs (World Space canvas child of Camera)
└── UIInputBinder ← UIInputBinder.cs (assign all 5 modal refs)
| Component | Assign |
|---|---|
GameManager |
nothing |
InputManager.PlayerInput |
Actions = HearthwoodInputActions.inputactions; Default Map = “Player” |
SceneController |
Drag every SceneData asset into the Catalog list |
AmbientAudioManager |
Layers[] (e.g. Village Day, Night, Storm), Initial Layer Id |
InteractionAudio |
Each [SerializeField] AudioClip field (use placeholders for now) |
HUDController |
5 TMP fields + optional HP Bar Fill (Image with Fill Method = Horizontal) |
DialogueUI |
Panel, Portrait (Image), Name (TMP), Line (TMP), Choices Container (Vertical Layout Group), Hint (TMP), Choice Button Template (Button with TMP child) |
QuestLogUI |
Panel, Active Content, Completed Content, Quest Entry Template + Objective Template |
InventoryUI |
Grid (Grid Layout Group), Slot Template (Image + child Icon + Count TMP), Tooltip Panel + TMPs |
PauseMenuUI |
Panel + 4 Buttons (assign onClick in inspector or rely on [SerializeField] Button _resumeButton etc.) |
UIInputBinder |
Assign the 4 modal MonoBehaviours + Dialogue UI reference |
InteractPromptUI |
World-space canvas child, assign CanvasGroup + prompt TMP |
PlayerController3D |
Camera Transform reference (assigned to _interactionCamera); HealthComponent, InventoryComponent, CombatController, FootstepPlayer on children |
NPCController |
NavMeshAgent auto-added via RequireComponent; NPCData asset; Interact Range default 3 |
com.unity.ai.navigation package — already
in manifest.json).PlayerCamera.cs; drag Player into Target field.PlayerCamera.cs with a Cinemachine 3rd-person rig
(the contract is read-only — any camera that follows the player works).If something doesn’t work, check the Console for errors. The most common issues:
Assets/Settings/HearthwoodInputActions.inputactionsChoices[] on the last node — edit via the DialogueDataEditor inspectorBuilds/WebGL/.index.html from any static host (GitHub Pages, itch.io, etc.).WebGL-specific gotchas already handled by this prototype:
SaveSystem uses PlayerPrefs (IndexedDB on WebGL), no System.IO.FileApplication.persistentDataPath only used as fallback in SceneControllerSee ASSETS.md for the recommended pack list and import settings. The
prototype will run with primitive cubes if no assets are imported, but the visual quality
is a placeholder until you drop in real meshes/materials.
Before merging changes:
Application.persistentDataPath is not used in any hot pathInput.GetKey / legacy input anywhere (grep)ARCHITECTURE.md §10 integration greps pass (see the file)[SerializeField] private (no public fields on MonoBehaviours)If you just want to see what the prototype plays like without installing Unity:
Games/Hearthwood/preview.html in any browser (double-click works).The preview is a vanilla-JS port of the gameplay systems. It does NOT need the Unity Editor, asset packs, or any build step.