我正在使用此脚本在完成时销毁游戏对象,但它不起作用。
void Jump()
{
if (currentCube.transform.position.y == 0f)
{
iTween.MoveTo (currentCube, iTween.Hash ("y", currentCube.transform.position.y - 15f, "time", 0.8f, "oncomplete", "DestroyOnComplete", "oncompletetarget", currentCube, "easeType", "easeInCubic", "loopType", "none", "delay", 0));
}
}
public void DestroyOnComplete()
{
Destroy (currentCube);
Debug.Log ("Destroyed " + currentCube);
}
有谁知道为什么这不起作用?