Class TerribleHealthBarScript
This class manages the health bar visuals for a player, including updating the health bar's size, position, and color based on the player's current health.
Inheritance
object
TerribleHealthBarScript
Namespace: Game
Assembly: cs.temp.dll.dll
Syntax
public class TerribleHealthBarScript : MonoBehaviour
Fields
actualHealthVisual
The actual health bar that reflects the player's current health.
Declaration
public GameObject actualHealthVisual
Field Value
| Type | Description |
|---|---|
| GameObject |
deathVisual
The visual representation of the player's death state.
Declaration
public GameObject deathVisual
Field Value
| Type | Description |
|---|---|
| GameObject |
fullDeathColor
The color of the health bar when the player is at zero health.
Declaration
public Color fullDeathColor
Field Value
| Type | Description |
|---|---|
| Color |
fullHealthColor
The color of the health bar when the player is at full health.
Declaration
public Color fullHealthColor
Field Value
| Type | Description |
|---|---|
| Color |
healthVisual
The visual representation of the health bar.
Declaration
public GameObject healthVisual
Field Value
| Type | Description |
|---|---|
| GameObject |
player
The player associated with this health bar.
Declaration
public GameObject player
Field Value
| Type | Description |
|---|---|
| GameObject |
smoothSpeed
The speed at which the health bar updates smoothly.
Declaration
public float smoothSpeed
Field Value
| Type | Description |
|---|---|
| float |
subtractionColor
The color used to represent health subtraction.
Declaration
public Color subtractionColor
Field Value
| Type | Description |
|---|---|
| Color |
text
The text element displaying the player's current and maximum health.
Declaration
public TextMeshProUGUI text
Field Value
| Type | Description |
|---|---|
| TextMeshProUGUI |
Methods
SetPlayer(GameObject)
Sets the player associated with this health bar.
Declaration
public void SetPlayer(GameObject player)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | player | The player to associate with this health bar. |