A class in Root.Township, Alta.QuickAccessActions.
Client debug health bar: a quad above a creature that shows its health stat. Made by ToggleEnemyHealthBars.
Constructors
| Member | What it is |
|---|
HealthBar(Transform enemy, Stat healthStat, Shader shader, Vector3 barScale, float verticalOffset, int _Progress) | Creates a HealthBar from enemy, healthStat, shader, barScale, verticalOffset and _Progress. |
Fields
| Member | What it is |
|---|
Transform transform | The bar quad's transform, parented to the creature. |
3 private and internal fields
| Member | What it is |
|---|
private readonly int _Progress | Shader property id for the bar's fill. |
private Stat healthStat | The health stat shown. |
private Material material | The bar's own material instance. |
Methods
| Member | What it is |
|---|
void Dispose() | Unhooks from the stat and destroys the material and quad. |
void UpdateHealthBar(Stat s) | Sets the shader progress to health between its default minimum and maximum. Runs when the stat changes. |
void UpdateRotation(Vector3 headPosition) | Turns the bar to face the given head position, flat on the Y axis. |
2 private and internal methods
| Member | What it is |
|---|
private Transform GetHealthBar(Vector3 barScale) | Creates the quad, scales it, removes its collider and gives it the bar material. |
private float GetHighestPointOnCreature(Transform creature) | Height of the creature's highest collider above its position. |
Used in
Members of other types that take, return or hold a HealthBar: