Skip to main content

RandomTreeValue

A class in Root.Township, the global namespace.

Animator state behaviour that sets a float parameter (usually a blend tree value) to a random value when the state is entered, optionally through the NetworkAnimator.

Constructors​

MemberWhat it is
RandomTreeValue()Creates a RandomTreeValue with default values.

Fields​

6 private and internal fields
MemberWhat it is
private bool isBinaryPick only minimum or maximum, half the time each.
private bool isNetworkedSet the value through the NetworkAnimator so the server's value syncs to clients.
private bool isNetworkLerpedWhen networked, write to the lerped network float instead of the plain one.
private float maximumUpper bound.
private float minimumLower bound.
private string valueNameFloat parameter to set, Blend by default.

Methods​

MemberWhat it is
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)Sets the float on the Animator, or when networked sets it on the NetworkAnimator from the server only.
1 private and internal method
MemberWhat it is
private float GetValue()Random value between the bounds, or one of the two bounds if binary.