I am working on a Unity2 game, and I want to make Boom disappear in the end of iTween
animation.
Here is part of code
void OnMouseDown() {
if (ChosePosition == false)
ChosePosition = true;
// make Star stop
else if (ChosePosition == true && ChoseForce == false) {
ChoseForce = true;
//Compute Force power
PowerDegree = Mathf.Abs (Star.transform.position.y - StarPosition)/ Mathf.Abs(StarendPosition - StarPosition) * 100;
//print (PowerDegree);
Vector3 NewBoomPostion = new Vector3 (Luncher.transform.position.x, BoomPosition, 85);
GameObject newBoom = Instantiate(Boom, NewBoomPostion , Quaternion.identity) as GameObject;
iTween.MoveTo (newBoom, iTween.Hash
("y",BoomPosition+((BoomendPosition-BoomPosition)/100*PowerDegree),
"speed",Boomspeed,
"EaseType",BoomeaseType,
"LoopType",BoomloopType,
"oncomplete","BoomComplete"
));
CarrierReset = true;
ChosePosition = false;
ChoseForce = false;
//After Shot, Luncher will move
iTween.Resume(Luncher);
//After Shot, Luncher Carrier will display
displayCarrierOrNot = true;
}
}
void BoomComplete(){
print("complete");
}
But I can't see "complete" in console.