This document is about: QUANTUM 3
SWITCH TO

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...

eventasset creation

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:

  1. Add the AnimationEventData component to the same GameObject the contains Animator component, in your QuantumEntityPrototype:
eventasset creation
  1. On the Animation window select the clip and add a new Unity AnimationEvent:
eventasset creation
  1. Select the created event and specify the Function and Object as the image below:
eventasset creation
Back to top