ExitEvent.

ExitEvent(AnimancerNode, Action, bool) Constructor

Summary

Creates a new Animancer.ExitEvent.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
ExitEvent

Syntax

public ExitEvent(AnimancerNode node, Action callback, bool invokeOnStartExiting = false)

Remarks

Example:
private ExitEvent _OnStateExited;

void ExitEventExample(AnimancerComponent animancer, AnimationClip clip)
{
    var state = animancer.Play(clip);
    
    // One line initialization:
    (_OnClipExit ??= new(state, OnStateExited)).Enable();
    
    // Or two lines:
    _OnClipExit ??= new(state, OnStateExited);
    _OnClipExit.Enable();
}

private void OnStateExited()
{
    Debug.Log(_OnClipExit.State + " Exited");
}

Parameters

Name Type Description
node AnimancerNode
callback Action
invokeOnStartExiting bool

Return Value

Type Description
void