Animation Registry

Register

The AnimationManager updates all animations. An animation will only play if it is registered to the AnimationManager instance.

AnimationManager.instance.Register(animation)

This happens automatically in many cases when working with the Animatables API. Here are the instances in which an animation is registered automatically:

  • When AnimationData.Play is called

  • When an animation is created with any AnimationCreator extension (e.g., transform.Move)

  • When an AnimatableUIObject's Disable or Enable method is called (the relevant list of animations will be registered)

  • When an AnimatableUIObject's PlayCustomAtIndex method is called

  • When AnimatableTransform.Play is called (the entire list of animations will be registered)

Unregister

The AnimationManager automatically unregisters completed animations. When animations are removed from any Animatable component using any remove animation method, the animation is unregistered as well.

Using AnimationData.Pause does not unregister the animation; it is simply paused. To manually unregister an animation, use the code below.

AnimationManager.instance.Unregister(animation)

Unregister All

To unregister all animations, you can use AnimationManager.ClearAllAnimationsImmediate.

AnimationManager.instance.ClearAllAnimationsImmediate();

Last updated