AnimancerEvent.

AnimancerEvent.Sequence Class

Summary

A variable-size list of Animancer.AnimancerEvents which keeps itself sorted according to their Animancer.AnimancerEvent.normalizedTime.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IEnumerable<AnimancerEvent>"] Type-.->Interface1["ICloneable<AnimancerEvent.Sequence>"] Type["AnimancerEvent.Sequence"] class Type type-node

Syntax

public class AnimancerEvent.Sequence : IEnumerable<AnimancerEvent>, 
    ICloneable<AnimancerEvent.Sequence>

Remarks

Animancer Lite doesn't allow events (except for ) in runtime builds.

Documentation: Animancer Events

Constructors

Name Summary
Sequence() Creates a new Animancer.AnimancerEvent.Sequence which starts at 0 Animancer.AnimancerEvent.Sequence.Capacity.

Adding anything to the sequence will set the Animancer.AnimancerEvent.Sequence.Capacity = Animancer.AnimancerEvent.Sequence.DefaultCapacity and then double it whenever the Animancer.AnimancerEvent.Sequence.Count would exceed the Animancer.AnimancerEvent.Sequence.Capacity.
Sequence(AnimancerEvent.Sequence) Creates a new Animancer.AnimancerEvent.Sequence and copies the contents of `copyFrom` into it.
Sequence(int) [Pro-Only] Creates a new Animancer.AnimancerEvent.Sequence which starts with the specified Animancer.AnimancerEvent.Sequence.Capacity. It will be initially empty, but will have room for the given number of elements before any reallocations are required.

Fields

Name Constant Value Summary
DefaultCapacity 4
The initial Animancer.AnimancerEvent.Sequence.Capacity which will be used if another value is not specified.
static

Properties

Name Value Summary
Capacity int
[Pro-Only] The size of the internal array used to hold events.
Count int
[Pro-Only] The number of events in this sequence, excluding the Animancer.AnimancerEvent.Sequence.EndEvent.
EndEvent AnimancerEvent
A Animancer.AnimancerEvent.callback which will be triggered every frame after the Animancer.AnimancerEvent.normalizedTime has passed as long as the animation is playing.
IsEmpty bool
Does this sequence have no events in it, including the Animancer.AnimancerEvent.Sequence.EndEvent?
Names StringReference[]
The names of the events, excluding the Animancer.AnimancerEvent.Sequence.EndEvent.
NormalizedEndTime float
Shorthand for EndEvent.normalizedTime.
OnEnd Action
A callback which will be triggered every frame after the Animancer.AnimancerEvent.normalizedTime has passed as long as the animation is playing.
this[int] AnimancerEvent
[Pro-Only] Returns the event at the specified `index`.
this[StringReference] AnimancerEvent
[Pro-Only] Returns the event with the specified `name`.
Version int
The number of times the contents of this sequence have been modified. This applies to general events, but not the Animancer.AnimancerEvent.Sequence.EndEvent.

Methods

Name Value Summary
Add(AnimancerEvent) int
[Pro-Only] Adds the given event to this sequence. The Animancer.AnimancerEvent.Sequence.Count is increased by one and if required, the Animancer.AnimancerEvent.Sequence.Capacity is doubled to fit the new event.
Add(float, Action) int
[Pro-Only] Adds the given event to this sequence. The Animancer.AnimancerEvent.Sequence.Count is increased by one and if required, the Animancer.AnimancerEvent.Sequence.Capacity is doubled to fit the new event.
Add(int, AnimancerEvent) int
[Pro-Only] Adds the given event to this sequence. The Animancer.AnimancerEvent.Sequence.Count is increased by one and if required, the Animancer.AnimancerEvent.Sequence.Capacity is doubled to fit the new event.
Add(int, float, Action) int
[Pro-Only] Adds the given event to this sequence. The Animancer.AnimancerEvent.Sequence.Count is increased by one and if required, the Animancer.AnimancerEvent.Sequence.Capacity is doubled to fit the new event.
AddAllEvents(AnimationClip) void
[Pro-Only] Copies the UnityEngine.AnimationClip.events into this Animancer.AnimancerEvent.Sequence.
AddCallback(int, Action) void
[Pro-Only] Adds the specified `callback` to the event at the specified `index`.
AddCallback(StringReference, Action) void
[Pro-Only] Adds the specified `callback` to the event with the specified `name`.
AddCallback<T>(int, Action<T>) Action
[Pro-Only] Adds the specified `callback` to the event at the specified `index`. Animancer.AnimancerEvent.GetCurrentParameter``1 will be used to get the callback's parameter.
AddCallback<T>(StringReference, Action<T>) Action
[Pro-Only] Adds the specified `callback` to the event with the specified `name`. Animancer.AnimancerEvent.GetCurrentParameter``1 will be used to get the callback's parameter.
AddCallbacks(StringReference, Action) int
[Pro-Only] Adds the specified `callback` to every event with the specified `name` and returns the number of events that were found.
AddCallbacks<T>(StringReference, Action<T>) int
[Pro-Only] Adds the specified `callback` to every event with the specified `name` and returns the number of events that were found. Animancer.AnimancerEvent.GetCurrentParameter``1 will be used to get the callback's parameter.
AddRange(IEnumerable<AnimancerEvent>) void
[Pro-Only] Adds every event in the `enumerable` to this sequence using Animancer.AnimancerEvent.Sequence.Add(Animancer.AnimancerEvent).
Clear() void
Removes all events, including the Animancer.AnimancerEvent.Sequence.EndEvent.
Clone() AnimancerEvent.Sequence
Creates a new Animancer.AnimancerEvent.Sequence and copies the contents of this into it.
Clone(CloneContext) AnimancerEvent.Sequence
Creates a new object with the same type and values this.
CopyFrom(AnimancerEvent.Sequence) void
DeepToString(bool) string
Returns a string containing the details of all events in this sequence.
GetDefaultNormalizedEndTime(float) float
The default Animancer.AnimancerEvent.normalizedTime for an Animancer.AnimancerEvent.Sequence.EndEvent when playing forwards is 1 (the end of the animation) and when playing backwards is 0 (the start of the animation).

`speed` 0 or System.Single.NaN will also return 1.
static
GetDefaultNormalizedStartTime(float) float
The default Animancer.AnimancerState.NormalizedTime for an animation to start at when playing forwards is 0 (the start of the animation) and when playing backwards is 1 (the end of the animation).

`speed` 0 or System.Single.NaN will also return 0.
static
GetEnumerator() FastEnumerator<AnimancerEvent>
[Pro-Only] Returns a Animancer.FastEnumerator`1 for the events in this sequence, excluding the Animancer.AnimancerEvent.Sequence.EndEvent.
GetName(int) StringReference
Returns the name of the event at the specified `index` or null if it's outside of the Animancer.AnimancerEvent.Sequence.Names array.
GetRealNormalizedEndTime(float) float
Returns the Animancer.AnimancerEvent.Sequence.NormalizedEndTime but converts System.Single.NaN to its corresponding default value: positive speed ends at 1 and negative speed ends at 0.
IndexOf(AnimancerEvent) int
[Pro-Only] Returns the index of the `animancerEvent` or -1 if there is no such event.
IndexOf(int, AnimancerEvent) int
[Pro-Only] Returns the index of the `animancerEvent` or -1 if there is no such event.
IndexOf(StringReference, int) int
Returns the index of the first event with the specified `name` or -1 if there is no such event.
IndexOfRequired(AnimancerEvent) int
[Pro-Only] Returns the index of the `animancerEvent`.
IndexOfRequired(int, AnimancerEvent) int
[Pro-Only] Returns the index of the `animancerEvent`.
IndexOfRequired(StringReference, int) int
Returns the index of the first event with the specified `name`.
Remove(AnimancerEvent) bool
[Pro-Only] Removes the `animancerEvent` from this sequence by decrementing the Animancer.AnimancerEvent.Sequence.Count and copying all events after the removed one down one place. Returns true if the event was found and removed.
Remove(int) void
[Pro-Only] Removes the event at the specified `index` from this sequence by decrementing the Animancer.AnimancerEvent.Sequence.Count and copying all events after the removed one down one place.
Remove(StringReference) bool
[Pro-Only] Removes the event with the specified `name` from this sequence by decrementing the Animancer.AnimancerEvent.Sequence.Count and copying all events after the removed one down one place. Returns true if the event was found and removed.
RemoveCallback(int, Action) void
[Pro-Only] Removes the specified `callback` from the event at the specified `index`.
RemoveCallback(StringReference, Action) void
[Pro-Only] Removes the specified `callback` from the event with the specified `name`.
RemoveCallbacks(StringReference, Action) int
[Pro-Only] Removes the specified `callback` from every event with the specified `name` and returns the number of events that were found.
SetCallback(int, Action) void
[Pro-Only] Replaces the Animancer.AnimancerEvent.callback of the event at the specified `index`.
SetCallback(StringReference, Action) void
[Pro-Only] Replaces the Animancer.AnimancerEvent.callback of the event with the specified `name`.
SetCallbacks(StringReference, Action) int
[Pro-Only] Replaces the Animancer.AnimancerEvent.callback of every event with the specified `name` and returns the number of events that were found.
SetName(int, StringReference) void
Sets the name of the event at the specified `index`.
SetNormalizedTime(AnimancerEvent, float) int
[Pro-Only] Sets the Animancer.AnimancerEvent.normalizedTime of the matching `animancerEvent`.
SetNormalizedTime(int, float) int
[Pro-Only] Sets the Animancer.AnimancerEvent.normalizedTime of the event at the specified `index`.
SetNormalizedTime(StringReference, float) int
[Pro-Only] Sets the Animancer.AnimancerEvent.normalizedTime of the event with the specified `name`.