Class ScyllaUILayoutAnimator
Per-stack animator that smoothly interpolates child positions and sizes between
successive layout solves. Listens to Scylla.Core.Util.UI.ScyllaUIStackBase.OnSolved;
after each solve it snaps each child back to its previously-applied
anchoredPosition/sizeDelta and starts a ScyllaTween animation
toward the freshly solved values.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/UI/Layout/Layout Animator")]
[DisallowMultipleComponent]
[RequireComponent(typeof(ScyllaUIStackBase))]
[ExecuteAlways]
public sealed class ScyllaUILayoutAnimator : MonoBehaviour
Remarks
The animator is disabled by default so existing scenes keep their instant-snap behavior; toggle Enabled to opt in. When disabled the per-child snapshot map is still kept up to date so re-enabling at runtime picks up smoothly from the current state.
Because ScyllaUILayoutRoot owns the solve pass, the animator
interpolates directly between prior and current solved layouts - there is no
"ghost hierarchy" of hidden RectTransforms required (which is the common
workaround when mixing Unity's built-in LayoutGroup with tweens).
Properties
AnimatePosition
When true, the animator tweens anchoredPosition deltas between
successive solves. When false, the solver's direct position write is left
intact and no position tween is created, so children snap immediately to their new
positions each layout pass.
Declaration
public bool AnimatePosition { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
AnimateSize
When true, the animator tweens sizeDelta deltas between successive
solves. When false, the solver's direct size write is left intact and no size
tween is created, so children snap immediately to their new sizes each layout pass.
Declaration
public bool AnimateSize { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Duration
Tween duration in seconds. The setter clamps the value to zero or above. A value of zero causes an instant snap to the solved layout with no tween launched; the animation code path is only entered when this is greater than zero.
Declaration
public float Duration { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Ease
Easing curve applied to both the position and size tweens. Both animation channels use this curve when AnimatePosition and AnimateSize are enabled; changing it mid-animation takes effect on the next solve.
Declaration
public EaseType Ease { get; set; }
Property Value
| Type | Description |
|---|---|
| EaseType |
Enabled
Master on/off, independent of the component's enabled flag. When
false, the animator still records per-solve snapshots, so toggling this back
to true at runtime resumes smoothly from the current state, but it does not
start tweens. Disabling the component itself (OnDisable) is a separate
lifecycle event that kills tweens and clears snapshots.
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |