Dowload as PDF

1.6. Events

Common Info

Events, just as Curves – are a replacement to the standard Unity events, which can be called in animation. Unlike them, these entities are not attached to animation clip, they are attached to the particular state of AnimationController.

There are two types of Events:

  1. One shot – standard mechanic. Within limits of normalized time state a point is selected. When state enters that point, this Event is triggered.
  2. Between – when setting up the even you can select not a point of normalized time state, but a period of it. Unlike One shot, three events wil be called: entering the period, exiting the period, and every update within the period.

Events can also be "guaranteed" and "not guaranteed". "Not guaranteed" events process only the last triggering of the events. Guaranteed events process all events that should have happened since the last frame. This option can be useful if the state is very short, if lag has occured and eaten up a few cycles of states, and you need Event to occur on every of those cycles.

Events offer the following C# events for subscribing to:

  1. OnStart (only for Between) – occurs on entering current normalized time state in the set period.
  2. OnFire – triggers upon reaching the normalized time state of the set point, or every frame the given time is inside the set period.
  3. OnEnd (only for Between) – occurs on exiting current normalized time state from the set period.

Editor

  1. Type – type of a given Event.
  2. Layer weight tolerance – weight threshold of state layer, after which event starts to trigger.
  3. Is guaranteed – whether this event is guaranteed or not.
  4. Value – point or period at which event should trigger.
  5. State – state, to which the event is attached to.
  6. Conditional parameter – boolean paramaters which controls whether given Event should trigger.

It's important to understand, that in case of Between Event parameters Layer weight tolerance and Conditional parameter upon changing can cause triggering of OnStart and OnEnd. For example, if the state is located inside the set period and parameter is change from true to false, then OnEnd will be called.

Yes No
0 of 0 users found this section helpful
Suggest Edit