Skip to main content

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​

MemberWhat it is
AnimatedFloatTransitionAiHook()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private float changePerSecondHow much the float goes up each second while the action runs. Default 1.
private AltaCoroutine coroutineThe running Coroutine, or null.
private float endValueValue set when the action ends. Default 1.
private string floatNameAnimator parameter name.
private Dictionary<IAgent, AnimatedFloat> floatsThe networked float per creature currently running the action.
private bool isLerpingWhether to use the lerping networked float.
private float startValueValue set when the action starts. Default 0.

Methods​

MemberWhat 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
MemberWhat it is
private IEnumerator Coroutine() (iterator)Each frame, adds changePerSecond times delta time to every running creature's float, until none are left.