Animator - ManeFunction/ManeTools-Unity GitHub Wiki

Namespace Mane.Unity.Animator.

AnimatorRandomizer

On state enter, the first matching SwitchCondition sets an int selector to Random.Range(0, TotalVariants). Leave the condition parameter empty for “always”.

Typical use: a blend-tree or sub-state machine keyed by that int.

If you have conditional cases, move them to the top. The condition list is checked in order. Here is an example with two conditions: the first one (when the flag is active) selects from all four animation states, and the other uses only two of them:

AnimatorRandomizer example

AnimatorParameterResetter

On state enter, this resets a bool, int, or float parameter to its default value (false or 0).

Typical use: one-shot animations that can be fired once by a trigger. The reset value is not configurable.

AnimatorParameterResetter example

AnimationEventInvoker

Put AnimationEventInvoker on the same object as the Animator. In the clip, add an event that calls public InvokeEvent. Assign listeners on the component,

AnimationEventInvoker sample

or subscribe in code:

animationEventInvoker.AnimationEventInvoked += PlayFootstep;

This can be useful when your controller is on a different GameObject and you only need a small proxy to catch the event and forward it.

AnimationEventParticleSystemInvoker

AnimationEventParticleSystemInvoker does the same with the event name InvokeParticleSystem and plays an assigned ParticleSystem.

AnimationEventParticleSystemInvoker sample