Tween

Simple Tweener Unity3D

simple-tweener-unity3d

Tween your numbers, colors, translations with ease.

Check Assets/Tweener/Tests for examples.

alt-text

Functions, Extentions and Method calls:

Float Tween, creates a tween that invokes your onUpdateAction each frame (it holds time left until tween dies). Foundation for future tweening methods.

FloatTween.CreateTween(duration:float, onUpdateAction:Action<float>, onEndAction:Action);

Transform tweens:

transform.TweenPosition(Vector3 endPosition, float duration, Action onEnd);
transform.TweenLocalPosition(Vector3 endPosition, float duration, Action onEnd);
transform.TweenScale(Vector3 endScale, float duration, Action onEnd);
transform.SwingPosition(float duration, float height, Action onEnd);

Tween options: Repeats tween. Default = 0. Set to -1 to repeat infinite times.

tween.Repeat(int count);

Starts the tween.

tween.Start();

Cancels the tween the next possible frame.

tween.Cancel();

You can also stack/chain methods:

transform.TweenScale(Vector3.one, 1, null).Repeat(10);