Vixen
02b45cc4
csharp
public sealed class AnimationEventBuffer

Where a frame's events are collected.

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

Remarks

A buffer rather than a callback, because an event fires in the middle of evaluating a blend tree — a point at which the pose is half-built, the layer stack is mid-flight, and a handler that reacted by changing a parameter or destroying the entity would be doing it to a system that is iterating itself. Draining the buffer after the pose is finished is the only ordering that lets a handler do the obvious thing.

The list is reused across frames — Clear keeps its capacity — so a character that fires two events a second settles at zero allocations after the first one.

Fields and properties (2)

  • public int Count

    How many events this frame produced.

  • public FiredAnimationEvent this[int index]

    The events, in the order they were emitted.

Methods (3)

  • public void Add(in FiredAnimationEvent fired)

    Records an event.

  • public void Clear()

    Empties the buffer, keeping its capacity.

  • public List<FiredAnimationEvent>.Enumerator GetEnumerator()

    Walks this frame's events.

Used by (7)

  • AnimationClipVixen.Animation
  • AnimationClipTestsVixen.Animation.Tests
  • AnimatorVixen.Animation
  • AnimatorTestsVixen.Animation.Tests
  • MotionContextVixen.Animation
  • StateMachineInstanceVixen.Animation
  • StateMachineTestsVixen.Animation.Tests