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.
- Listed in Creatures and AI
- Inherits or implements
MonoBehaviour - Documented in Movement and pathfinding
Constructors
| Member | What it is |
|---|---|
WalkerAnimator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private NetworkAnimator animator | The networked animator the parameters belong to. |
private AnimatedFloat forwardSpeed | Float parameter set from the walker's forward speed. |
private string forwardSpeedName | Animator parameter name for forward speed. Empty skips it. |
private AnimatedBool grounded | Bool parameter set from whether the walker is grounded. |
private string groundedName | Animator parameter name for grounded. Empty skips it. |
private AnimatedBool pivot | Bool parameter set while the walker is pivoting. |
private string pivotName | Animator parameter name for pivot. Empty skips it. |
private AnimatedBool stopping | Bool parameter set during the walker's final stretch to its goal. |
private string stoppingName | Animator parameter name for stopping. Empty skips it. |
private AnimatedFloat turnSpeed | Float parameter set from the walker's turn speed. |
private string turnSpeedName | Animator parameter name for turn speed. Empty skips it. |
Methods
5 private and internal methods
| Member | What 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. |