public readonly record struct AnimationConditionOne test a transition has to pass.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Greater and Less are strict, and there is no GreaterOrEqual. Unity's set, and for a reason worth keeping: a graph whose transitions fire on exact equality of a float is a graph that works until the value arrives as 0.30000001. Equality is offered for whole numbers only, where it means something.
A trigger is not read here. IsSatisfied peeks at it, because a transition with three conditions must not consume a trigger when the other two fail. The consumption happens in Consume, which only the transition that was actually taken calls.
Fields and properties (3)
public int ParameterThe index of the parameter being tested.
public AnimationConditionMode ModeHow it is compared.
public float ThresholdWhat it is compared against. Ignored by If and IfNot.
Methods (5)
public AnimationCondition(int Parameter, AnimationConditionMode Mode, float Threshold = 0)One test a transition has to pass.
public static AnimationCondition On(AnimationParameters parameters, string parameter, AnimationConditionMode mode, float threshold = 0)Builds a condition against a named parameter, declaring it if it is not already.
public static AnimationCondition OnTrigger(AnimationParameters parameters, string trigger)Builds a condition on a trigger, declaring it if it is not already.
public bool IsSatisfied(AnimationParameters parameters)Whether the condition holds, without taking anything.
public void Consume(AnimationParameters parameters)Takes whatever this condition consumes. Called only by a transition that was taken.
Used by (4)
- AnimationTransitionVixen.Animation
- StateMachineTestsVixen.Animation.Tests
- AnimationGraphCompilerVixen.Editor.AnimationGraph
- AnimationGraphTestsVixen.Editor.AnimationGraph.Tests