PlayerHealthBar

Renders the player's current HP as a row of heart Toggle widgets. Subscribes to LevelManager events automatically at [DefaultExecutionOrder(10)].

Inspector Fields

FieldTypeDescription
heartPrefabToggleToggle prefab instantiated once per maximum HP point.
healthContainerTransformParent transform that receives the spawned heart toggles.

Methods

MethodDescription
Initialize(LevelInfo level)Clears existing hearts and spawns new ones based on the level's max HP. Called automatically on LevelManager.OnInitialize.
InitializeContext(ExecutionContext context)Subscribes to context.player.health.OnHealthUpdated for the current run. Called automatically on LevelManager.OnPlay.
UpdateHealth(int value)Toggles hearts on or off to reflect the current HP value.
AddHearts(int value)Spawns additional heart widgets at runtime (e.g. for HP bonuses).
Reset(ExecutionContext context)Sets all hearts back to full. Called automatically on LevelManager.OnReset.

PlayerStaminaBar

Renders the player's current stamina as a row of pip Toggle widgets. Follows the same pattern and event subscription as PlayerHealthBar.

Inspector Fields

FieldTypeDescription
pointPrefabToggleToggle prefab instantiated once per maximum stamina point.
containerTransformParent transform that receives the spawned pip toggles.

Methods

MethodDescription
Initialize(LevelInfo level)Clears existing pips and spawns new ones based on the level's max stamina. Called automatically on LevelManager.OnInitialize.
InitializeContext(ExecutionContext context)Subscribes to context.player.stamina.OnValueUpdated. Called automatically on LevelManager.OnPlay.
UpdatePoints(int value)Toggles pips on or off to reflect the current stamina value.
AddPoints(int value)Spawns additional pip widgets at runtime.
Reset(ExecutionContext context)Sets all pips back to full. Called automatically on LevelManager.OnReset.

HUD_ShowStatEffectNumber

Displays a floating number above a character whenever damage, healing, or a block event fires. Add this component as a child of any GameObject that owns a Health or PlayerStamina component. It locates those components via GetComponentInParent in Start() — no Inspector wiring required.

Inspector Fields

FieldTypeDescription
numberTextTMP_TextText element that displays the numeric value or the "Blocked" label.
negativeColorColorColor applied to incoming damage numbers. Default: red.
positiveColorColorColor applied to healing or stamina gain numbers. Default: blue.
blockedColorColorColor applied when a "Blocked" label is shown. Default: green.

Methods

MethodDescription
ShowNumber(int number)Sets the text to the given value, applies negativeColor for damage or positiveColor for healing, and triggers the pop-in animation.
ShowBlockSign()Sets the text to "Blocked", applies blockedColor, and triggers the animation. Called automatically on Health.OnDamageBlocked.

Events subscribed

EventResponse
Health.OnDamageAppliedCalls ShowNumber(int) with the damage value.
Health.OnDamageBlockedCalls ShowBlockSign().
PlayerStamina.OnValueChangedCalls ShowNumber(int) with the stamina delta.