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

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条回答 默认 最新

  • 陈言必行 2021-06-22 09:08
    已采纳

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

    点赞 打赏 评论

相关推荐 更多相似问题