AnimatedFloatTransitionAiHook
A class in Root.Township, Alta.Intelligence.
AI hook that sets a networked animator float on start, raises it at a steady rate while the action runs, and sets an end value when it ends.
Constructors
| Member | What it is |
|---|
AnimatedFloatTransitionAiHook() | 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 changePerSecond | How much the float goes up each second while the action runs. Default 1. |
private AltaCoroutine coroutine | The running Coroutine, or null. |
private float endValue | Value set when the action ends. Default 1. |
private string floatName | Animator parameter name. |
private Dictionary<IAgent, AnimatedFloat> floats | The networked float per creature currently running the action. |
private bool isLerping | Whether to use the lerping networked float. |
private float startValue | Value set when the action starts. Default 0. |
Methods
| Member | What it is |
|---|
protected override void FinishedOrCancelled(IActiveAction finished) | Sets the float to endValue and stops tracking that creature. Doesn't check the creature still exists. |
protected override void Used(IActiveAction active) | Sets the float to startValue and starts the shared coroutine if it isn't running. |
1 private and internal method
| Member | What it is |
|---|
private IEnumerator Coroutine() (iterator) | Each frame, adds changePerSecond times delta time to every running creature's float, until none are left. |