1. 程式人生 > >unity3d中執行專案出現的問題

unity3d中執行專案出現的問題

當我對一個unitypackage檔案進行build & run時出現以下錯誤

Destroy may not be called from edit mode! Use DestroyImmediate instead.
Also think twice if you really want to destroy something in edit mode. Since this will destroy objects permanently.

“在編輯模式下不能呼叫Destroy方法,請使用DestroyImmediate方法代替。“

於是我在U3D中雙擊錯誤,程式碼在VS裡開啟,找到所有呼叫Destory的地方,替換成DestroyImmediate。好了!