Repository navigation
Animator
Namespace Mane.Unity.Animator. State machine behaviours use ManeStyle inspectors.
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.
On state enter, resets a bool / int / float parameter to false / 0 / 0. Typical use: clear IsAttacking when idle starts. The reset value is not configurable.
Put AnimationEventInvoker on the same object as the Animator. In the clip, add an event named InvokeEvent. Subscribe in code:
using Mane.Unity.Animator;
GetComponent<AnimationEventInvoker>().AnimationEventInvoked += PlayFootstep;AnimationEventParticleSystemInvoker does the same with event name InvokeParticleSystem and plays an assigned ParticleSystem.
Screenshot:
animator-randomizer.png— state inspector with conditions and variant count. Host athttps://raw.githubusercontent.com/wiki/ManeFunction/ManeTools-Unity/animator-randomizer.png.
openupm add com.manefunction.tools-unity