Tween Sequence
Combine clips into an animation with shared timing
Overview
A Tween Sequence is an ordered collection of clips with one shared clock. It can store clips locally or use a Sequence Preset.
Sequences appear inside Tween Animator states and Evo UI components with custom animations. You can also expose a TweenSequence field in your own component.
Parallel and Sequential
Clips are arranged in groups, working down the list:
- Parallel places a clip at the current group's start, plus its own delay.
- Sequential starts a new group after every clip in the previous group has finished, then applies its own delay.
The first clip starts the first group regardless of its flow setting. A group finishes when its longest clip, including delay and iterations, finishes.
Example: Show a Panel, Then Its Content
| Clip | Flow | Delay | Duration | Plays at |
|---|---|---|---|---|
| Panel scale | Parallel | 0 | 0.3 | 0.0–0.3s |
| Panel alpha | Parallel | 0.1 | 0.3 | 0.1–0.4s |
| Content slide | Sequential | 0 | 0.2 | 0.4–0.6s |
| Content alpha | Parallel | 0.05 | 0.15 | 0.45–0.6s |
The content waits until both panel clips finish. The content fade then shares the slide's group start, with an extra 0.05s delay. The whole sequence lasts 0.6s.
Reordering clips can change group boundaries, so check the timeline after moving a Sequential clip.
Time Mode
Scaled follows Time.timeScale. Unscaled keeps using unscaled delta time, which is useful for pause menus.
Time Mode belongs to the consuming sequence, including when a preset is assigned. The preset shares clip definitions; each sequence keeps its own clock and target bindings.
The player chooses the update phase. For Tween Animator, set Update Phase on the state. For a triggered sequence, use WithUpdatePhase() on the returned handle.
Using a Preset
Assign a preset to replace the sequence's effective clip definitions. Assign target components on the consuming sequence, so the same preset can animate different objects.
Local inline clips remain stored while a preset is attached. Clearing the preset reference returns to those inline clips. Detach in the Timeline Window instead copies the preset's current clips and local targets into the sequence.
Public API
Use TweenSequence in the Evo.Tween namespace.
| Member | Description |
|---|---|
TimeMode | Scaled or Unscaled. |
Preset | Optional shared clip definitions. |
InlineClips | Mutable local clip list, used when no preset is attached. |
Clips | Effective definitions from the preset or inline list. |
Count, Duration | Effective clip count and calculated sequence duration. |
GetTarget(int index), SetTarget(int index, Component target) | Gets or sets the consuming sequence's target for a clip. |
DetachPreset(bool copyClips = true) | Detaches the asset; by default copies its clips and local targets inline. |
Clone() | Copies the sequence configuration while retaining referenced assets and target objects. |
Playing a preset sequence
For preset sequences, Clips contains asset definitions. Passing that list directly to TweenClip.Trigger doesn't include the sequence's local target bindings. Use a Tween Animator state or a TweenSequenceSampler when those bindings matter.
Manual Sampling
TweenSequenceSampler lets a custom component choose the playback time. Create it once, use Sample(seconds) to apply a position, and call Restore() to undo the preview or Release() to keep the sampled values. Dispose it when finished.
Prepare() reserves sampling data without changing target values. With cacheClips: true, prepared data is retained across captures until you refresh, change its source, or dispose it. See For Developers for an example.