Enum 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.
Namespace: Scylla.Core.Util.Tween
Assembly: ScyllaCore.dll
Syntax
public enum LoopType
Fields
| Name | Description |
|---|---|
| Incremental | At the end of each loop iteration the tween does not reset. Instead, the total
interpolated output accumulates by the distance between the start and end values
with every completed pass. The CompletedLoops counter is
passed to the incremental lerp functions in TweenLerp (e.g.,
FloatIncremental(float, float, float, int)) so they can offset the result
monotonically:
For example, tweening a position
Use |
| Restart | At the end of each loop iteration the tween resets its elapsed time to zero and begins the same interpolation again from the original start value. The animated property jumps instantaneously from the end value back to the start value between iterations, creating a sawtooth waveform over time.
Use |
| Yoyo | Each odd-numbered iteration plays the tween forward (from start to end) and each even-numbered iteration plays it in reverse (from end to start), toggling direction on every boundary crossing. The transition between directions is completely smooth because the eased progress is simply mirrored rather than reset, producing a sinusoid-like waveform over time.
The easing curve is also reversed during the backward phase, so an
Use |