Skip to content

A tweening library for unity3D to tween floats, vectors, quaternions and colors.

Notifications You must be signed in to change notification settings

oddruud/tween-unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tween-unity

A lightweight tweening library for unity3D to tween floats, vectors, quaternions and colors. Easily combine easing functions for more complex effects. Tween either based on time or speed.

usage:

Create a GameObject and attach the TweenController behaviour.

Looping yoyo scale tween example:

Using Rucrede;

Vector3 scale = someTransform.localScale;
Tween scaleTween = Tween.to(scale, scale * 2f, 1.0f, Tween.EaseType.easeInCubicOutSine, 
  (Tween tween) => {someTransform.localScale = (Vector3) tween.Value;},
  (Tween tween) => {/*handle complete*/}
  , 0f, true, -1);

Color tween example:

Using Rucrede;

Color color1 = new Color(0f, 0f,0f, 1.0f);
Color color2 = new Color(0f, 0f,0f, 1.0f);
Tween colorTween = Tween.to(color1, color2, 1.0f, Tween.EaseType.easeInBack, 
  (Tween tween) => {someMaterial.SetColor("_COLOR", (Color) tween.Value);},
  (Tween tween) => {/*handle complete*/},
  , 0f, false, 0);

Rotate tween effect example:

Using Rucrede;

Quaternion toRotation = someTransform.rotation * Quaternion.Euler(Vector3.up * 90f);
Tween rotateTween = Tween.to(someTransform.rotation, toRotation, 1.0f, Tween.EaseType.easeInBounce, 
  (Tween tween) => {someTransform.rotation = (Quaternion) tween.Value;},
  (Tween tween) => {/*handle complete*/},
  , 0f, false, 0);

About

A tweening library for unity3D to tween floats, vectors, quaternions and colors.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages