iTween is a handy library to implement tween/ease type animations. One of the useful callback it provides is the onComplete event. Below is an example code of how to use it:
Debug.Log(“The shade is hidden”);
where lotus_leaf is the game object to be tweened in y position, and OnShadeHidden() is the callback function or event handler.
However if you run this code, you will see the callback OnShadeHidden is NOT fired when the tween is completed! The reason is that iTween needs another parameter: onCompleteTarget, to specify which object handles the onComplete event, so the right way to get it done will be like this:
Run the code, the onComplete event handler will be properly addressed. Happy coding!