Vixen
02b45cc4
csharp
public sealed class AnimationState

One state of a layer's graph: something to play, and the ways out of it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A state is a name, a Motion and a list of transitions — and the motion is why the type is this small. Whether the state plays one clip or a two-dimensional locomotion tree is the motion's business, so "idle" and "the whole of ground movement" are the same kind of thing and the graph does not grow a node type for each.

Fields and properties (6)

  • public string Name

    What it is called.

  • public Motion Motion

    What it plays.

  • public float Speed

    How fast, relative to the motion's own length. May be negative to play backwards.

  • public WrapMode Wrap

    What happens when the motion reaches its end.

  • public IReadOnlyList<AnimationTransition> Transitions

    The ways out, tried in order.

  • public int Index

    Where this state sits in its machine, or −1 before it is added to one.

Methods (4)

  • public AnimationState(string name, Motion motion)

    Creates a state.

  • public AnimationState AddTransition(AnimationTransition transition)

    Adds a way out.

  • public AnimationTransition TransitionTo(AnimationState destination, float duration = 0.2)

    Adds a way out, and returns it so conditions can be added to it.

  • public override string ToString()

    Returns a string that represents the current object.

Used by (12)

  • RigsVixen.Benchmarks.Animation
  • AnimationStateMachineVixen.Animation
  • AnimationTransitionVixen.Animation
  • AnimatorTestsVixen.Animation.Tests
  • ConstraintStageTestsVixen.Animation.Tests
  • ConstraintTestsVixen.Animation.Tests
  • EcsIntegrationTestsVixen.Animation.Tests
  • NetworkAnimatorTestsVixen.Net.Animation.Tests
  • StateMachineInstanceVixen.Animation
  • StateMachineTestsVixen.Animation.Tests
  • AnimationGraphCompilerVixen.Editor.AnimationGraph
  • AnimationGraphTestsVixen.Editor.AnimationGraph.Tests