I am in a situation were I need a variable to to tweened from 0 to an undefined target. Preferably I would like to have some sort of easing on this movement. Like the easeTypes found in iTween.
I have tried to use ValueTo but I cant seem to get my desired variable out of it as it takes a gameObject.
Anyways is there a way, using iTween or not, to animate variables with easetypes? Also in C# preferably.
iTween functions take a gameObject because they use coroutines (I think so anyway). If your final value is going to change, you should do a value to between 0 and 1 and use that result as the t in Mathf.Lerp( 0, endValueThatCanChange, t );
You can accomplish this using LeanTween. Here is an example in javascript:
function updateNewValue( val:float ){
Debug.Log("the tweened new value:"+val);
}
function Start(){
var from:float = 3.8;
var to:float = 9.3;
var time:float = 2.0;
var options = {};
LeanTween.value(updateNewValue, from, to, time, options);
}