This page is a work in progress and could be pending updates.
Events
Introduction
Quantum Animator provides support for instant events. In future version the tool will also provide support for time-window based events.
Creating a New Event
Events assets can be created using Create->Quantum->Assets...
Events will trigger the Execute()
function once the Animator plays the clip that contains such event baked. A good pattern is to inherit from the base AnimatorEventAsset
and override the
base class methods with different procedures, like custom Frame.Siganls
.
C#
public unsafe class AnimatorEventAsset : AssetObject
{
public virtual void OnBake(AnimatorEvent animatorEvent, AnimationClip unityAnimationClip,
AnimationEvent unityAnimationEvent)
{
}
public virtual void Execute(Frame f, AnimatorComponent* animator)
{
Debug.Log("Execute Event.");
}
}
Event Setup
Follow these steps to define the event on an animation clip:
- Add the
AnimationEventData
component to the same GameObject the containsAnimator
component, in yourQuantumEntityPrototype
:
- On the Animation window select the clip and add a new
Unity AnimationEvent
:
- Select the created event and specify the
Function
andObject
as the image below: