Property Chaining

Property/method chaining is a technique that allows multiple properties to be assigned in a single statement without requiring a variable to store the intermediate results. This is most useful when creating new tweens. See the PropertyChaining Scripting API for a full list of properties that can be chained.

⛓️ Examples

// using a tween shortcut
transform.TweenPosition(, 1f)
         .SetLoops(-1, LoopType.PingPong)
         .OnLoop(() => Debug.Log("looped!"));
// building from scratch
Tween tween = new Tweener<Transform, Vector3>(transform)
     .SetGetter((target) => target.position)
     .SetSetter((target, value) => target.position = value)
     .OnComplete(() => Debug.Log("complete!"));