Performance and lifecycle

What Cascade does every frame, what it costs, and what happens to an animation when the UI around it changes.

What runs each frame

  • One scheduler tick per UI panel drives every animation on that panel. Cascade doesn't use Update(), coroutines or a MonoBehaviour.
  • No per-frame garbage. Tweens are pooled and reused, and the update loop makes no allocations. The test suite checks this by measuring GC allocations while stepping many animations.
  • Values are computed in plain C# and written to style. Cascade doesn't depend on Unity's experimental animation API.
  • Animations run on unscaled time, so a paused game (Time.timeScale = 0) still animates its pause menu.

Cheap and expensive properties

VerbsPropertyCost
Fade, MoveX/Y/To, Nudge, ScaleTo, Rotate, SlideInopacity and transformscheap: no layout
BackgroundColor, TextColorcolorscheap: repaint only
Width, Height, Size, Top, Leftlayoutre-runs layout each frame
BlurTo, TintTo (Pro, Unity 6.3+)filteran extra render pass each frame

Animate many elements with the cheap verbs. Use the layout verbs where the box really has to resize, such as an accordion.

For very large groups, such as hundreds of grid cells, Pro's AnimateAll and StaggerFade run one shared animation for the whole group instead of one per element. See the API reference.

When the element leaves the screen

An animation cancels itself when its element is removed from the panel, for example when a screen closes or a list row is recycled. Cascade never writes to an element that is no longer displayed. A cancelled animation doesn't call OnComplete; OnSettled receives false, and await returns false.

Starting a new animation on a moving element

Each property is a channel: opacity, translate X, translate Y, scale, rotate, width, height, top, left. Starting a new animation on a channel replaces the one already running on it, from the current value, so there is no jump. Other channels keep going: a new fade doesn't stop a move.

A replaced animation counts as cancelled, so it never calls OnComplete. Use OnSettled for anything that must happen either way. In Pro, a replaced spring hands its velocity to the new animation.

Nudge, NudgeX and NudgeY don't claim a channel. They add on top of whatever is moving the element.

Stopping

var h = el.Animate().Fade(1f, 0.3f);
h.Cancel();                                       // this animation
el.StopAnimations();                              // everything on the element
el.StopAnimations(MotionChannel.Opacity);         // one property; the rest keeps going

Stopping leaves the element where it is. An animation that reaches its end on its own snaps exactly to its target.

Measuring

Debug.Log(MotionSettings.Stats);   // active panels, sequences and tweens, plus pooled tweens

MotionSettings.Stats is allocation-free. Show it on a debug overlay, or check in a test that animations really stopped.

Platforms

Cascade is pure C# with no native code and no dependencies. It runs wherever UI Toolkit runs in Unity 6000.0 and later. Each release is tested in the editor and in a built standalone player.