首页 > 解决方案 > Unity Editor 场景为黑色

问题描述

我在 Unity 中创建了一个新项目,但我总是在统一控制台中收到此错误,而我的场景只是黑色

图片

我的版本是2019.4.0f1 personal

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.HostView.DeregisterSelectedPane (System.Boolean clearActualView, System.Boolean sendEvents) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.HostView.SetActualViewInternal (UnityEditor.EditorWindow value, System.Boolean sendEvents) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.HostView.set_actualView (UnityEditor.EditorWindow value) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.DockArea.OnEnable () (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()

我什么都没做,我只是创建了这个项目

标签: c#unity3d

解决方案


似乎它无法加载窗口首选项(LoadDefaultWindowPreferences)。这些是编辑器设置,也是您在全新项目中看到错误的原因。

重置布局通常可以解决这个问题:Window->Layouts->Revert Factory Settings。


推荐阅读