ExitEvent Class

Summary

[Pro-Only] A callback to be triggered after an Animancer.AnimancerNode either starts or finishes fading out to 0 Animancer.AnimancerNode.EffectiveWeight.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
graph BT Type-->Base0["Updatable"] click Base0 "/animancer/api/Animancer/Updatable" Base0-->Base1["Object"] Type-.->Interface0["IUpdatable"] click Interface0 "/animancer/api/Animancer/IUpdatable" Type["ExitEvent"] class Type type-node

Syntax

public class ExitEvent : Updatable, IUpdatable

Remarks

The Animancer.AnimancerNode.EffectiveWeight is only checked at the end of the animation update so if it's set multiple times in the same frame then the callback might not be triggered.

Most Finite State Machine systems already have their own mechanism for notifying your code when a state is exited so this system is generally only useful when something like that is not already available.

Example: see the Animancer.ExitEvent.#ctor(Animancer.AnimancerNode,System.Action,System.Boolean) constructor.

Constructors

Name Summary
ExitEvent(AnimancerNode, Action, bool) Creates a new Animancer.ExitEvent.

Properties

Name Value Summary
Callback Action
The method to invoke when this event is triggered.
InvokeOnStartExiting bool
Should the Animancer.ExitEvent.Callback be invoked when the Animancer.ExitEvent.Node starts fading out? Otherwise, it will be invoked after the Animancer.AnimancerNode.EffectiveWeight reaches 0. Default is false.
Node AnimancerNode
The target node which determines when to trigger this event.

Methods

Name Value Summary
Disable() void
Cancels this event to stop receiving updates.
Enable() void
Registers this event to start receiving updates.
EnableIfActive() void
Registers this event to start receiving updates if the Animancer.AnimancerNode.TargetWeight is above 0 (i.e. it's not fading out).
Update() void
Updates this object.