Skip to main content

WalkerAnimator

A class in Root.Township, Alta.Pathfinding.

Copies a Walker's state (speed, turn, pivot, stopping, grounded) into NetworkAnimator parameters each update. A component next to the Walker.

Constructors​

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

Fields​

11 private and internal fields
MemberWhat it is
private NetworkAnimator animatorThe networked animator the parameters belong to.
private AnimatedFloat forwardSpeedFloat parameter set from the walker's forward speed.
private string forwardSpeedNameAnimator parameter name for forward speed. Empty skips it.
private AnimatedBool groundedBool parameter set from whether the walker is grounded.
private string groundedNameAnimator parameter name for grounded. Empty skips it.
private AnimatedBool pivotBool parameter set while the walker is pivoting.
private string pivotNameAnimator parameter name for pivot. Empty skips it.
private AnimatedBool stoppingBool parameter set during the walker's final stretch to its goal.
private string stoppingNameAnimator parameter name for stopping. Empty skips it.
private AnimatedFloat turnSpeedFloat parameter set from the walker's turn speed.
private string turnSpeedNameAnimator parameter name for turn speed. Empty skips it.

Methods​

5 private and internal methods
MemberWhat it is
private void Awake()Subscribes UpdateAnimation to the Walker's Updated event.
private AnimatedBool GetBool(string name)Gets the animator bool with that name, or null if the name is empty.
private AnimatedFloat GetFloat(string name)Gets the animator float with that name, or null if the name is empty.
private void Start()Looks up the animator parameters from the configured names.
private void UpdateAnimation(WalkerState state)Writes the walker state's forward speed, turn speed, pivoting, final stretch and grounded values to the parameters that exist.