Animatables
  • đŸ•šī¸Getting Started
    • Introducing Animatables
    • Installation
    • Components
      • Animation Data
      • Animation Manager
        • Animation Curve Presets
      • Animatable Transform
      • Animatable UI Objects
    • Easing Curves
  • 📄Scripting Basics
    • Animation Registry
    • Creating Animations
      • Animation Creator
      • Animating Numbers
      • Animating Colors
      • Animating Transform
      • Animating Rect Transform
      • Easing Animations
    • Getting Animations
    • Add or Remove Animations
    • Editing Animations
    • Events
  • đŸ› ī¸Support
    • Getting Help
    • Contact
  • 📚Changelogs
    • Latest Releases
Powered by GitBook
On this page
  • From an Animatable
  • Animatable UI Objects
  • Animatable Transform
  • From the Animation Creator
  1. Scripting Basics

Getting Animations

From an Animatable

You can get an animation from any Animatable component.

Animatable UI Objects

You can get the on enable, on disable, or custom call animations of any AnimatableRectTransform, AnimatableImage, AnimatableCanvasGroup, AnimatableText, and AnimatableButton by index.

// Getting the first animation of each animation type
// 'animatable' is any AnimatableUIObject
UIAnimationData enableAnim = animatable.onEnableAnimations[0];
UIAnimationData disableAnim = animatable.onDisableAnimations[0];
UIAnimationData customCallAnim = animatable.customCallAnimations[0];

Animatable Transform

Animatable transforms only consist of a single list of animations. Similar to the animatable UI objects, you can get the animation by index.

// Getting the first animation
// 'animatable' is an AnimatableTransform
TransformAnimationData anim = animatable.animations[0];

From the Animation Creator

When an animation is created by any Animation Creator extension (such as transform.Move, rectTransform.Rotate, etc.), the created animation is returned. So, you can get the animation by simply creating a variable for it.

// 'number' is a float
AnimationData anim = AnimationCreator.FloatAnimation(0, 100, (x) => number = x, 1);
PreviousEasing AnimationsNextAdd or Remove Animations

Last updated 12 months ago

📄