Skip to main content

AnimatedLayerAiHook

A class in Root.Township, Alta.Intelligence.

AI hook that sets a networked animator layer weight on the creature when the action starts and another when it ends.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private bool isLerpWhether the weight blends to new values. Default true.
private string layerNameAnimator layer name.
private float weightOnEndWeight set when the action ends. Default 1.
private float weightOnStartWeight set when the action starts. Default 1.
private Dictionary<IAgent, AnimatedLayerWeight> weightsThe networked layer weight per creature, kept until the action ends.

Methods​

MemberWhat it is
protected override void FinishedOrCancelled(IActiveAction finished)Sets the layer weight to weightOnEnd.
protected override void Used(IActiveAction active)Sets the layer weight to weightOnStart, lerped if isLerp is set.