Unity因爲對象鎖定在運行時會拋出錯誤

今天在對很多對象身上的腳本的參數進行配置,自己就將對象進行了鎖定,擋把對象鎖定後,在運行遊戲的時候在控制檯拋出以下錯誤:

MissingReferenceException: The object of type 'AudioLoadAssetsBundle' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.GenericInspector.GetOptimizedGUIBlock (Boolean isDirty, Boolean isVisible, UnityEditor.OptimizedGUIBlock& block, System.Single& height) (at C:/buildslave/unity/build/Editor/Mono/Inspector/GenericInspector.cs:19)
UnityEditor.InspectorWindow.FlushOptimizedGUIBlock (UnityEditor.Editor editor) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1430)
UnityEditor.InspectorWindow.FlushOptimizedGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1420)

只需要將鎖定的對象關閉即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章