Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
BossHealthbarHUD Class Reference

Detailed Description

This script provides functions for other scripts to update the boss's healthbar on the Canvas. There are functions for:

  • Setting the health filled percentage.
  • Setting the boss's display name.
  • Setting the healthbar's visibility.

Documentation updated 12/27/2024

Author
Alexander Art
Todo
Create healthbar animations for when the boss spawns, takes damage, or gets defeated.

Public Member Functions

void SetHealthbarPercentage (float healthbarPercentage)
 Sets the healthbar's width and position to be filled a certain percentage.
 
void SetDisplayName (string bossName)
 Changes the text above the healthbar.
 
void SetHealthbarVisible (bool isVisible)
 

Protected Attributes

RectTransform healthbarUnderside
 Reference to the healthbar underside, which is what the healthbar takes the shape of.
 
RectTransform healthbar
 Reference to the red healthbar part of this object that shrinks as the boss takes damage.
 
TMP_Text bossNameText
 Reference to the TextMeshPro above the healthbar that displays the boss's name.
 

Member Function Documentation

◆ SetDisplayName()

void BossHealthbarHUD.SetDisplayName ( string bossName)

Changes the text above the healthbar.

Parameters
bossNameThe string that will be displayed.

◆ SetHealthbarPercentage()

void BossHealthbarHUD.SetHealthbarPercentage ( float healthbarPercentage)

Sets the healthbar's width and position to be filled a certain percentage.

Parameters
healthbarPercentageThe percentage full the healthbar will be set to.

◆ SetHealthbarVisible()

void BossHealthbarHUD.SetHealthbarVisible ( bool isVisible)

Member Data Documentation

◆ bossNameText

TMP_Text BossHealthbarHUD.bossNameText
protected

Reference to the TextMeshPro above the healthbar that displays the boss's name.

◆ healthbar

RectTransform BossHealthbarHUD.healthbar
protected

Reference to the red healthbar part of this object that shrinks as the boss takes damage.

◆ healthbarUnderside

RectTransform BossHealthbarHUD.healthbarUnderside
protected

Reference to the healthbar underside, which is what the healthbar takes the shape of.


The documentation for this class was generated from the following file: