Hi, i’ve got a problem with itween, i can’t get the oncomplete callback working. Here is the code:
Both functions are in the same gameObject, i tried to write events in lowerCase, CamelBack, UpperCase, tried to put with and without “onCompleteTarget” with no result…
public void Spin()
{
float lobTime = 1F;
float lobHeight = 1F;
iTween.MoveBy(gameObject, iTween.Hash(“y”, lobHeight, “time”, lobTime / 2, “easeType”, iTween.EaseType.easeOutQuad));
iTween.MoveBy(gameObject, iTween.Hash(“y”, -lobHeight, “time”, lobTime / 2, “delay”, lobTime / 2, “easeType”, iTween.EaseType.easeInCubic));
iTween.RotateBy(gameObject, iTween.Hash(“x”, .5, “time”, .5, “easetype”, “easeinoutback”, “delay”, lobTime / 3, “oncomplete”, “segmentComplete”, “onCompleteTarget”, gameObject));
iTween.RotateBy(gameObject, iTween.Hash(“x”, 1, “time”, .5, “easetype”, “easeinoutback”, “delay”, lobTime / 3));
}
public void segmentComplete()
{
setSelected(false);
getValues();
}