Enemy HUD
Five components that make up the visual display above each enemy: a stat panel shown on hover, a health counter, an action indicator showing the current instruction, a full action-sequence panel, and the individual action layout element.
EnemyStatsContainer
Loop Adventure › Enemy › HUD › EnemyStatsContainer
Spawns a row of stat elements for each of the enemy's stats (damage, defence, and any additional stats) and wires panel visibility to the parent EnemyController's mouse-hover event. The panel is hidden by default and shown only while the cursor is over the enemy. Populated automatically by EnemyController.Awake() — no manual wiring needed beyond assigning the two references below.
| Field | Type | Description |
|---|---|---|
statLayoutPrefab | StatElement_Layout | Prefab instantiated once per stat to display the enemy's stats in the HUD. |
container | RectTransform | Parent transform that holds the spawned stat element rows. |
| Method | Description |
|---|---|
Initialize() | Reads all stats from the parent EnemyController, spawns one StatElement_Layout per stat under container, and subscribes panel visibility to EnemyController.OnMouseHover. Called automatically by EnemyController.Awake(). |
EnemyHealthBar
Loop Adventure › Enemy › HUD › EnemyHealthBar
Displays the enemy's current health as a text counter. Subscribes automatically to the sibling EnemyHealth component's events — no manual wiring needed beyond assigning the label.
| Field | Type | Description |
|---|---|---|
healthCounter | TMP_Text | Text label that shows the current health value. |
EnemyInstructionIndicator
Loop Adventure › Enemy › HUD › EnemyInstructionIndicator
Shows animated transitions between the enemy's current and previous actions. Displays two icon slots — entry (incoming action) and exit (outgoing action) — and drives an Animator for the slide-in/slide-out transitions. Wired by EnemyController.Initialize() automatically.
| Field | Type | Description |
|---|---|---|
entryInstruction | Image | Icon for the current active instruction. |
exitInstruction | Image | Icon for the previous instruction — visible during the transition animation. |
| Method | Description |
|---|---|
Initialize(EnemyController controller) | Subscribes to the controller's action-start, action-change, and action-end events. Called automatically by EnemyController — not needed in user code. |
EnemyActionSequencePanel
Loop Adventure › Enemy › HUD › EnemyActionSequencePanel
Renders the enemy's full attack sequence as a grid of icons. Each entry shows one EnemyAction with its loop count. The panel toggles visibility on mouse hover and is populated once during EnemyController.Initialize().
| Field | Type | Description |
|---|---|---|
container | RectTransform | Parent that receives the spawned EnemyAction_Layout elements. |
layoutPrefab | EnemyAction_Layout | Prefab used to spawn one entry per action. |
| Method | Description |
|---|---|
Initialize(EnemyActionInstance[] actionInstances) | Spawns one EnemyAction_Layout per action instance and populates it with the action icon and loop count. |
EnemyAction_Layout
Loop Adventure › Enemy › HUD › EnemyAction_Layout
Prefab-based widget for a single entry in the EnemyActionSequencePanel. Use CreateInstance to spawn and configure it.
| Field | Type | Description |
|---|---|---|
icon | Image | Displays the action's icon sprite. |
loopsText | TMP_Text | Shows how many times the action repeats in the sequence. |
| Method | Description |
|---|---|
CreateInstance(EnemyAction action, int loops, RectTransform container) | Instantiates a copy of this prefab inside container, sets the icon and loop count, and returns the new instance. |