Summary
A
Animancer.AnimancerEvent.callback
that will be triggered every frame after the Animancer.AnimancerEvent.normalizedTime
has
passed. If you want it to only get triggered once, you can either have the event clear itself or just
use a regular event instead.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Containing Type
- AnimancerEvent
.Sequence
Syntax
public AnimancerEvent EndEvent { get; set; }
Examples
void PlayAnimation(AnimancerComponent animancer, AnimationClip clip)
{
var state = animancer.Play(clip);
state.Events.NormalizedEndTime = 0.75f;
state.Events.OnEnd = OnAnimationEnd;
// Or set the time and callback at the same time:
state.Events.EndEvent = new AnimancerEvent(0.75f, OnAnimationEnd);
}
void OnAnimationEnd()
{
Debug.Log("Animation ended");
}
Remarks
Documentation: End Events
Interrupting the animation does not trigger this event.
By default, the to be changed in Runtime Builds.
Animancer.AnimancerEvent.normalizedTime
will be System.Single.NaN
so that it can choose the
correct value based on the current play direction: forwards ends at 1 and backwards ends at 0.
Animancer Lite does not allow the Value
Type | Description |
---|---|
AnimancerEvent |
See Also
- Animancer.AnimancerEvent.Sequence.OnEnd
- Animancer.AnimancerEvent.Sequence.NormalizedEndTime