Animancer v6.0 is currently available for testing.

EndEventReceiver Class

Summary

A component which uses Animation Events with the Function Name "End" to invoke the Animancer.AnimancerEvent.Sequence.endEvent of the Animancer.AnimancerState that triggered the event.
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • MonoBehaviour
graph BT Type-->Base0["MonoBehaviour"] Type["EndEventReceiver"] class Type type-node

Syntax

[AddComponentMenu(Strings.MenuPrefix + "End Event Receiver")]
[HelpURL(Strings.DocsURLs.APIDocumentation + "/" + nameof(EndEventReceiver))]
public class EndEventReceiver : MonoBehaviour

Remarks

This component must always be attached to the same UnityEngine.GameObject as the UnityEngine.Animator in order to receive Animation Events from it.

Note that Unity will allocate some garbage every time it triggers an Animation Event with an UnityEngine.AnimationEvent parameter.

Documentation: End Animation Events

Attributes

Type Description
AddComponentMenu
HelpURLAttribute

Properties

Name Value Summary
Animancer AnimancerComponent
[UnityEngine.SerializeField] The Animancer.AnimancerComponent on which the Animancer.AnimancerEvent.Sequence.endEvent will be triggered.
CurrentEvent AnimationEvent
The UnityEngine.AnimationEvent called 'End' which is currently being triggered.
static

Methods

Name Value Summary
End(AnimancerComponent, AnimationEvent) bool
Tries to invoke the Animancer.AnimancerEvent.Sequence.endEvent of the Animancer.AnimancerState that triggered the `animationEvent`.
static
GetFadeOutDuration(float) float
If the Animancer.EndEventReceiver.CurrentEvent has a float parameter above 0, this method returns that value. Otherwise this method calls Animancer.AnimancerEvent.GetFadeOutDuration(System.Single) so if you aren't using an Animation Event with the function name "End" you can just call that method directly.
static
Reset() void
[Editor-Only] Called when this component is first added in Edit Mode. Finds the Animancer.EndEventReceiver.Animancer using Animancer.Editor.AnimancerEditorUtilities.GetComponentInHierarchy``1(UnityEngine.GameObject).