Files
Gnome-s-Bounty/Assets/Docs/SetupGuide.md
T
vova 39e4e51866 Add player controller, state management, and input handling
- Implemented PlayerController.cs to manage player movement and actions.
- Created PlayerState.cs to track player lives, coins, and key status.
- Added CameraFollow.cs for smooth camera movement following the player.
- Developed Character.cs as an abstract class for character behavior.
- Introduced Enums.cs for defining TreasureType and MapElementType.
- Added IDoor interface for door interactions.
- Created InputActions.cs for handling player input actions.
- Implemented MainMenu.cs for basic menu functionality including play and exit options.
2026-06-17 22:43:59 +03:00

4.7 KiB

Quick Setup Guide - Post Migration

Immediate Next Steps

1. Refresh Unity Project

  • Open the Gnome's Bounty project in Unity
  • Wait for asset import to complete
  • Check Console for any errors related to moved files

2. Create Required GameObjects in Scene

Add these to your main gameplay scene:

GameManager

  1. Right-click in Hierarchy → Create Empty
  2. Name it "GameManager"
  3. Drag GameManager script from Assets/Scripts/Managers/GameManager.cs onto it
  4. Leave settings at defaults (debug mode optional)

LevelManager

  1. Right-click in Hierarchy → Create Empty
  2. Name it "LevelManager"
  3. Drag LevelManager script from Assets/Scripts/Managers/LevelManager.cs onto it
  4. IMPORTANT: In Inspector, drag your Door GameObject to the _doorReference field
  5. Leave settings at defaults (debug mode optional)

NoiseSystem

  1. Right-click in Hierarchy → Create Empty
  2. Name it "NoiseSystem"
  3. Drag NoiseSystem script from Assets/Scripts/Managers/NoiseSystem.cs onto it
  4. Enemy Layer should be set to "Enemy" automatically
  5. Leave settings at defaults (debug mode optional)

3. Configure Layers

  1. In Hierarchy, select all enemy GameObjects
  2. In Inspector, change Layer to "Enemy"
  3. Create the layer if it doesn't exist (Layer dropdown → Add Layer → "Enemy")

4. Testing Checklist

After setup, test these features:

  • Hammer Throw: Throw hammer and verify cooldown works (should delay next throw by ~1.5 sec)
  • Enemy Stun: Hit an enemy with hammer, it should freeze for 1 second
  • Wall Break: Break a breakable wall with hammer
  • Noise System: Break a wall or hit enemy near another enemy - second enemy should investigate
  • Key Collection: Pick up key, GameManager should show HasKey = true
  • Door Unlock: After picking up key, door should open automatically
  • Level Complete: Exit through open door with key - should trigger level completion

5. If Compilation Errors Occur

Most likely causes:

  1. "Cannot find type 'GameManager'" - Make sure GameManager component is added to scene
  2. "Missing script references" - Delete and re-add the script component
  3. "Cannot find EnemyAI" - Verify EnemyAI.cs moved to Enemies/ folder correctly

Quick fix:

  • In Unity, go to Assets → Reimport All
  • Wait for compilation to complete
  • Check Console for remaining errors

6. Debug Features

To enable debug logging in managers:

  1. Select GameManager in Hierarchy
  2. In Inspector, check Debug Mode
  3. Repeat for LevelManager and NoiseSystem
  4. Play game - console will show state changes
  5. Remember to disable before final build

What If You Encounter Errors?

Scenes Won't Load

  • Unity may need to reload scenes
  • Close the scene, delete from Recent, and re-open

"CharacterSpawner" not found

  • This class was renamed to EnemySpawner
  • Update any scene prefabs or scripts that reference it
  • Check Enemies/EnemySpawner.cs

PlayerController Errors

  • Check that GetComponent<HammerThrower>() can still find it
  • If not, re-add PlayerController script to Player GameObject

Missing References in Inspector

  • Right-click the field → "Try Find Component"
  • Or manually drag the object from scene/hierarchy

Performance Notes

The new systems have minimal performance impact:

  • GameManager: O(1) operations, just stores state
  • LevelManager: Minimal, just tracks key/completion
  • NoiseSystem: O(n) where n = enemies in range (typically small)
  • EnemyAI States: Simple state switching, no AI overhead

No performance concerns with default settings.


Next Development Steps

With the architecture in place, you can now easily:

  1. Add new hammer effects - Modify Hammer.cs
  2. Add new enemy behaviors - Add states to EnemyAI.cs
  3. Add puzzles - Create new interaction systems using GameManager
  4. Add levels - Use GameManager/LevelManager for progression
  5. Add UI - Hook into GameManager events for HUD updates

All systems use events for loose coupling, making extensions clean and safe.


File Location Reference

What Location
Player Controller Assets/Scripts/Player/PlayerController.cs
Hammer Mechanics Assets/Scripts/Combat/Hammer.cs
Hammer Throwing Assets/Scripts/Player/HammerThrower.cs
Enemy AI Assets/Scripts/Enemies/EnemyAI.cs
Enemy Spawner Assets/Scripts/Enemies/EnemySpawner.cs
Game State Assets/Scripts/Managers/GameManager.cs
Level Control Assets/Scripts/Managers/LevelManager.cs
Noise System Assets/Scripts/Managers/NoiseSystem.cs
UI Manager Assets/Scripts/Managers/UIManager.cs
Environment Assets/Scripts/Environment/*.cs

Status: Ready to import into Unity and test! 🎮