StaminaBarVisibility
A class in Root.Township, Alta.StatSystem.
Client: fades the local player's left and right hand stamina bars in while stamina is below full and out when full. Hidden while downed.
- Listed in Stats, effects, heat and liquid
- Inherits or implements
MonoBehaviour - Nested types
HandStaminaView - Documented in Stats
Constructors
| Member | What it is |
|---|---|
StaminaBarVisibility() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private float alphaLerpSpeed | Alpha change per second when fading. |
private StatBarBase[] leftStamina | Stat bars for the left hand. |
private StaminaBarVisibility.HandStaminaView leftStaminaView | Fade logic for the left hand. |
private PlayerController player | The player controller whose death hides the bars. |
private StatBarBase[] rightStamina | Stat bars for the right hand. |
private StaminaBarVisibility.HandStaminaView rightStaminaView | Fade logic for the right hand. |
private Material staminaNotchMaterial | Notch material, cloned per hand and faded with the bars. |
Methods
6 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Initializes now if the local player controller exists, otherwise when it's set. |
private void Initialize(PlayerController controller = null) | Builds the left and right views and hooks the player's death. |
private void LateUpdate() | Updates both hands' bar alpha. |
private void OnDestroy() | Unhooks the local player and death events. |
private void OnEnable() | Sets both views' alpha to 0. |
private void PlayerDeath(HealthObject health) | Disables both hands' stamina bars. |