0
我正在使用此腳本銷燬一個gameObject oncomplete,但它不起作用。銷燬gameObject oncomplete
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);
}
有沒有人知道爲什麼這不起作用?
定義'不工作'。 – mjwills
你有調試線? – joreldraw
那麼它不會做任何事情,沒有錯誤,沒有調試。當前立方體掉下來並停在-15。 –