Manual / Setup Guides
Enemy Setup
Configure the health system, optional loot drop, and in-world HUD on an enemy prefab. Most of the wiring is handled automatically by EnemyController.Initialize() — these steps cover only what needs to be set up in the Inspector.
1. Add EnemyHealth
Add EnemyHealth to the enemy root GameObject (the same object that has EnemyController).
- Set Max Health.
- Assign Impact Sound, Block Sound, and Die Sound audio clips.
- Assign the Stat asset for the enemy's health stat.
The health bar in the enemy HUD subscribes to EnemyHealth automatically — no manual event wiring is needed. See Health.
2. (Optional) Add ItemDropper
If the enemy should drop a pickup on death, add ItemDropper to the enemy root.
- Assign the Item pickup prefab (
InteractableObject_Pickup) to theitemfield. - In the
EnemyHealthcomponent's On Die event slot, add a listener pointing toItemDropper.Drop.
See ItemDropper.
3. Set up the Enemy HUD
The enemy HUD lives in a world-space Canvas child of the enemy GameObject. It is built from up to four components:
- EnemyHealthBar — add to any child GameObject; assign the
healthCounterTMP_Text label. The component subscribes toEnemyHealthautomatically. - EnemyInstructionIndicator — assign
entryInstructionandexitInstructionImage slots.EnemyController.Initialize()subscribes it to action events automatically. - EnemyActionSequencePanel — assign
container(RectTransform) andlayoutPrefab(EnemyAction_Layout prefab). The panel populates on initialization and shows on hover. - EnemyAction_Layout — the prefab referenced by
EnemyActionSequencePanel.layoutPrefab; assigniconandloopsTextslots on the prefab itself.
See Enemy HUD for field details.
EnemyController.Initialize() runs at level start and handles all subscriptions automatically. You only need to fill in the Inspector fields described above — no code changes are required for a standard enemy setup.