I'm trying to ease a motionblur inside a script attached to the camera Hashtable ht = new Hashtable(); ht.Add("from",0); ht.Add("to",.92f); ht.Add("time",.5f); ht.Add("onupdate","changeMotionBlur"); iTween.ValueTo(this,ht); of course "this" is the script itself and not a gameobject, how can I make this work, also what am I supposed to put in the changeMotionBlur method, I can't any examples on their website or anywhere else
You will need to provide a GameObject to ValueTo() in order for this to work and your "onupdate" callback just needs to accept the same type of value you are trying to tween. If you can't use an existing GO maybe create a dummy one on the fly? void Start(){ //establish parameter hash: Hashtable ht = iTween.Hash("from",0,"to",.92f,"time",.5f,"onupdate","changeMotionBlur"); //make iTween call: iTween.ValueTo(gameObject,ht); } //since our ValueTo() iscalculating floats the "onupdate" callback will expect a float as well: void changeMotionBlur(float newValue){ //apply the value of newValue: print(newValue); } Also there are a few examples on the support page that show usage of ValueTo: http://itween.pixelplacement.com/examples.php
I bought the native extension, and .ValueTo seems not to be on the list of attached functions, is that correct?