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
  • Color AB
  • Color Array
  1. Scripting Basics
  2. Creating Animations

Animating Colors

Color animation scripting example.

Color AB

public class ColorAnimationTest : MonoBehaviour
{
    private Color color;

    private void Start()
    {
        // Animate a color from white to black in 1 second
        AnimationCreator.ColorAnimation(Color.white, Color.black, (x) => color = x, 1);
    }
}

Color Array

public class ColorAnimationTest : MonoBehaviour
{
    private Color color;

    private void Start()
    {
        // Animate through all colors in 1 second
        AnimationCreator.ColorAnimation(new Color[] { Color.white, Color.black, Color.red }, (x) => color = x, 1);
    }
}
PreviousAnimating NumbersNextAnimating Transform

Last updated 11 months ago

📄