Animation tweening libraries are in full force on the Unity Store. The most popular of which, iTween, has plenty of niceties in it including Editor tools, but is far too clunky for mobile device usage. The main reason behind this is that each tween is created with
Instantiate and finished with
Destroy; extrapolate this X times on Y amount of objects in real-time and the amount of garbage collection mounts up, causing major slowdowns and chugs.
I stumbled upon a really nice, lightweight tweening library on Unify Community called AniMate a while back, written in Boo originally. At the time of using this library, iOS did not support Boo (Python) to be deployed to it, so I ended up converting it to C#. It works fundamentally different from iTween so if you need something fast and easy, that won’t require a ridiculous amount of GC, this is pretty handy for small projects that use assets that don’t require actual Animation components.
For example, to use Ani.Mate on the
transform object on your current component, up 10 units in the Y position using an ElasticOut ease over the span of 2 seconds, you would do the following:
Hashtable props = new Hashtable();
// set position: 10 units in the Y direction
props.Add("position", new Vector3(0, 10f, 0));
// set easing type: Elastic
// set direction type: easeOut
Ani.Mate.To(transform, 2f, props);
You can find this full conversion at GitHub @bfowle/Ani.Mate. The current state, which I believe will be its final state, is good enough to work as-is. Any additional functionality, features, or fixes can be forked off this GitHub repository. Some of the changes I did to the original Boo version were renaming the longer version of the easing types to their shorter, more popular names (e.g. Exponential to Expo); as well as added a Spring easing algorithm from iTween.
I have spoken to the original author since doing the conversion back in July, and he has a new C# version of an animation tweening library started @sttz/Animate; however, I have noticed some math issues with most of the easing types in certain directions, most noticeably the ElasticOut ease.
UPDATE: I have since been using HOTween which is a wonderful, lightweight tweening library that is kept up to date by the author.