Namespace Scylla.Core.Util.Tween
Classes
Ease
Provides a complete library of static easing functions for tween interpolation.
Each function transforms a normalized time value t in the range
[0, 1] into an eased output value, mapping the tween's linear progress
to a curve that controls the perceived speed of the animation.
All functions respect the mathematical boundary conditions f(0) = 0
and f(1) = 1 except for easing types that intentionally overshoot
(Elastic, Back). Inputs outside [0, 1] produce extrapolated results
unless the individual function clamps them (InExpo, OutExpo, InOutExpo,
InElastic, OutElastic, InOutElastic).
The two primary entry points for the tween engine are Evaluate(EaseType, float) (for a one-off sample) and GetFunction(EaseType) (to cache a delegate for repeated evaluation). Individual named methods are also public so callers can invoke a specific curve directly without going through the dispatch switch.
ScyllaShapeTweenExtensions
Provides extension methods for animating the parameters of every Scylla 3D shape via
ScyllaTween. Each helper drives a single shape property over the requested
duration; the property setter triggers Rebuild() internally, so the mesh updates
every tween tick.
ScyllaTween
Primary static facade for the Scylla Tween system. Provides factory methods for creating all tween types, a managed update loop, global batch operations, and runtime configuration.
TweenAudioSourceExtensions
Provides extension methods for animating UnityEngine.AudioSource properties using the Scylla tween system.
Covers volume (with dedicated fade-in, fade-out, and fade-out-and-stop helpers), pitch, spatial blend, and stereo pan. All methods clamp their target values to the valid ranges accepted by UnityEngine.AudioSource.
All methods return a pre-configured tween instance sourced from TweenPool. The
tween is not started automatically - call Play() or
PlayManaged(ITween) on the returned instance to begin playback. The start
value is captured lazily from the UnityEngine.AudioSource at the moment playback begins,
unless you override it with a SetFrom call before playing.
TweenBase
Abstract base class for all tween implementations in the Scylla tween system. Encapsulates the complete lifecycle engine: state machine, timing, delay handling, easing, loop logic (Restart, Yoyo, Incremental), per-tween time scaling, callback dispatch, pool-reset contract, and optional TweenManager registration.
TweenCanvasGroupExtensions
Provides extension methods for animating UnityEngine.CanvasGroup components using the Scylla tween system.
Covers alpha (with dedicated fade-in and fade-out helpers) and a full-featured TweenFade(CanvasGroup, float, float, bool) method that optionally updates UnityEngine.CanvasGroup.interactable and UnityEngine.CanvasGroup.blocksRaycasts on completion.
All methods return a pre-configured tween instance sourced from TweenPool. The
tween is not started automatically - call Play() or
PlayManaged(ITween) on the returned instance to begin playback. The start
value is captured lazily from the UnityEngine.CanvasGroup at the moment playback begins,
unless you override it with a SetFrom call before playing.
TweenColor
A performance-optimized, sealed tween implementation that interpolates UnityEngine.Color values. Supports two modes: full RGBA color interpolation and alpha-only fade transitions. Suitable for animating material colors, UI element colors, sprite colors, and any other property expressed as a UnityEngine.Color.
TweenException
Exception thrown when a tween operation encounters an unrecoverable error.
TweenExtensions
Fluent extension methods on ITween that provide convenient shortcuts for common configuration, playback, callback, loop, type-cast, and utility patterns.
TweenFloat
A performance-optimized, sealed tween implementation that interpolates float values.
Avoids the generic-delegate overhead of Tween<T> and is the preferred choice
for animating scalar properties (alpha, volume, speed, fill amount, etc.).
TweenLerp
Provides optimized, type-specific interpolation functions used internally by the Scylla tween engine to compute animated property values each frame.
All standard interpolation methods use manual arithmetic rather than Unity's
Mathf.Lerp / Vector3.Lerp equivalents because those APIs clamp
t to [0, 1]. The tween engine passes eased progress values that
may legitimately exceed this range when using overshoot easing types such as
InElastic, OutBack, and their
variants. Unclamped arithmetic correctly propagates overshoot into the
interpolated output.
Incremental variants (e.g., FloatIncremental(float, float, float, int), Vector3Incremental(Vector3, Vector3, float, int)) are used when a tween's loop type is Incremental. Instead of interpolating between a fixed start and end value each pass, they accumulate a constant delta per completed loop iteration so the animated property advances monotonically over the entire animation lifetime.
These methods are not intended to be called directly by game code; use ScyllaTween factory methods to create tweens instead.
TweenManager
Centralized static registry that drives automatic frame-by-frame updates for all managed ITween instances and provides target-based batch operations.
TweenMaterialExtensions
Provides extension methods for animating UnityEngine.Material properties using the Scylla tween system.
Covers the main color, named and ID-keyed color properties, the main alpha channel, named and ID-keyed float properties, named and ID-keyed vector (Vector4) properties, as well as the main texture offset and scale.
All methods return a pre-configured tween instance sourced from TweenPool. The
tween is not started automatically - call Play() or
PlayManaged(ITween) on the returned instance to begin playback. The start
value is captured lazily from the material at the moment playback begins, unless you override it
with a SetFrom call before playing.
Overloads that accept an int property ID use the pre-hashed identifier returned by
PropertyToID(string), which is faster than the string-based lookups performed by
overloads that accept a property name. Prefer the ID overloads in performance-sensitive code.
TweenPool
Static façade over a set of ScyllaGenericObjectPool<T> instances, one per concrete tween type, that allows tween instances to be reused instead of heap-allocated on every animation request.
TweenQuaternion
A performance-optimized, sealed tween implementation that interpolates UnityEngine.Quaternion rotations using either spherical linear interpolation (Slerp, default) or normalized linear interpolation (Nlerp).
TweenRectTransformExtensions
Provides extension methods for animating UnityEngine.RectTransform components using the Scylla tween system.
Covers the anchored position (2D and 3D, with per-axis X/Y overloads), size delta (with dedicated width and height overloads), pivot, anchor minimum, and anchor maximum.
All methods operate on the RectTransform's layout properties and are designed for
use with Unity UI (UGUI) elements positioned within a Canvas. All methods return a
pre-configured tween instance sourced from TweenPool. The tween is not
started automatically - call Play() or
PlayManaged(ITween) on the returned instance to begin playback. The
start value is captured lazily from the UnityEngine.RectTransform at the moment playback
begins, unless you override it with a SetFrom call before playing.
TweenSequence
Orchestrates a timeline of ITween instances, callbacks, and intervals that play as a single coordinated unit.
TweenSettings
Static container for global configuration values that govern the default behaviour of all tweens created through the Scylla Tween system.
TweenSpriteRendererExtensions
Provides extension methods for animating UnityEngine.SpriteRenderer components using the Scylla tween system.
Covers the full RGBA color, alpha-only transitions, and dedicated fade-in and fade-out helpers.
All methods return a pre-configured tween instance sourced from TweenPool. The
tween is not started automatically - call Play() or
PlayManaged(ITween) on the returned instance to begin playback. The start
value is captured lazily from the UnityEngine.SpriteRenderer at the moment playback begins,
unless you override it with a SetFrom or SetFromAlpha call before playing.
TweenTransformExtensions
Provides extension methods for animating UnityEngine.Transform components using the Scylla tween system.
Covers world-space position, local position, individual position axes, world and local rotation (both UnityEngine.Quaternion and Euler overloads), local scale (uniform and per-axis), as well as higher-level movement helpers such as relative offset moves, punch-scale effects, position shakes, and look-at rotations.
All methods return a pre-configured tween instance sourced from TweenPool. The tween
is not started automatically - call Play() or
PlayManaged(ITween) on the returned instance to begin playback. The start
value is captured lazily from the transform at the moment playback begins, unless you override it
with a SetFrom call before playing.
TweenVector2
A performance-optimized, sealed tween implementation that interpolates UnityEngine.Vector2 values component-by-component. Suitable for animating 2D positions, UV offsets, anchor positions, pivot points, and any other two-component float property.
TweenVector3
A performance-optimized, sealed tween implementation that interpolates UnityEngine.Vector3 values component-by-component. The most commonly used tween type for 3D game development; suitable for animating world positions, local positions, Euler angles (as raw Vector3), scale, and any other three-component float property.
TweenVector4
A performance-optimized, sealed tween implementation that interpolates
UnityEngine.Vector4 values component-by-component.
Useful for animating four-component shader parameters, Rect-like float tuples,
or any other four-element float property that does not map to a more specific type.
Tween<T>
A fully generic tween that interpolates values of type T using
a caller-supplied getter, setter, and lerp function.
Structs
SequenceItem
Represents a single entry on the TweenSequence timeline. An item is one of three kinds - a child tween, an instant callback, or a silent interval - as indicated by ItemType.
TweenID
An immutable, type-safe numeric identifier that uniquely identifies a single tween instance within the Scylla Tween system.
Interfaces
ITween
Core interface implemented by all tween types in the Scylla Tween system.
Enums
EaseType
Identifies the easing algorithm applied to a tween's normalized time value during interpolation. Each value maps to a corresponding static method on Ease and controls the rate of change of the animated property over the tween's duration.
Easing types follow the standard naming convention popularised by Robert Penner:
-
Invariants accelerate from zero velocity - slow at the start. -
Outvariants decelerate toward zero velocity - slow at the end. -
InOutvariants combine both - slow at the start and at the end.
Some easing types (Elastic, Back) intentionally produce values outside the
[0, 1] range. The interpolation functions in TweenLerp
use unclamped arithmetic to preserve these overshoots correctly.
The special value Custom is a sentinel that signals the tween
engine to use a user-supplied delegate rather than a named curve. It is set
automatically when ITween.SetEase(Func<float, float>) is called
and should not normally be assigned directly.
LoopType
Defines how a tween behaves at the boundary between one loop iteration and the next.
The loop type is set via ITween.SetLoops(int, LoopType) together with the
number of iterations. A value of 0 for the loop count means no looping
(play once); -1 means infinite loops.
The three values represent three fundamentally different strategies for what the animated value does when a single pass completes:
- Restart - hard-reset; the value jumps back to the start.
- Yoyo - soft-reverse; the value glides back along the same curve.
- Incremental - cumulative; each pass adds a fixed delta to the running total, so the value keeps climbing (or falling) monotonically.
SequenceItemType
Categorises the content carried by a SequenceItem on a TweenSequence timeline.
TweenErrorCode
Structured error codes used by TweenException to categorise tween system failures without requiring callers to parse exception message strings.
TweenState
Describes the current lifecycle state of a tween managed by the Scylla Tween system.