腳尖托着腳尖 2021-06-21 23:32 采纳率: 100%
浏览 806
已采纳

Unity 重新加载脚本就报错!!,求大神帮忙看下!!

详细错误描述:NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GameObjectInspector.ClearPreviewCache () (at <40513f04ef114c8db39ee74008ebaf26>:0)
UnityEditor.GameObjectInspector.OnDisable () (at <40513f04ef114c8db39ee74008ebaf26>:0)

 

还有:

SerializedObjectNotCreatableException: Object at index 0 is null
UnityEditor.Editor.CreateSerializedObject () (at <40513f04ef114c8db39ee74008ebaf26>:0)
UnityEditor.Editor.GetSerializedObjectInternal () (at <40513f04ef114c8db39ee74008ebaf26>:0)
UnityEditor.Editor.get_serializedObject () (at <40513f04ef114c8db39ee74008ebaf26>:0)
UnityEditor.GameObjectInspector.OnEnable () (at <40513f04ef114c8db39ee74008ebaf26>:0)

 

  • 写回答

1条回答 默认 最新

  • 陈言必行 Unity领域优质创作者 2021-06-22 09:08
    关注

    就是这个方法中ClearPreviewCache,访问了不存在的(已删除的)游戏对象

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?