今天在对很多对象身上的脚本的参数进行配置,自己就将对象进行了锁定,挡把对象锁定后,在运行游戏的时候在控制台抛出以下错误:
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)
只需要将锁定的对象关闭即可。
本文介绍了解决在Unity中因对象锁定而导致的MissingReferenceException错误的方法。该错误通常出现在尝试访问已被销毁的对象时,并提供了一个简单的解决方案:解锁相关对象。
16万+

被折叠的 条评论
为什么被折叠?



