【问题标题】:Unity Editor Scene is blackUnity Editor 场景为黑色
【发布时间】:2020-06-14 21:15:49
【问题描述】:

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

Image

我的版本是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()

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

【问题讨论】:

  • 基本上,有些variablenull,代码会尝试访问variable.something
  • 我没有任何代码
  • 您是否安装了任何资产?
  • 不,我不这么认为,我只是启动了 unity hub 并创建了一个新的 3d 项目

标签: c# unity3d


【解决方案1】:

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

重置布局通常可以解决这个问题: 窗口->布局->恢复出厂设置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    相关资源
    最近更新 更多