【发布时间】:2020-06-14 21:15:49
【问题描述】:
我在 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()
我什么都没做,我只是创建了这个项目
【问题讨论】:
-
基本上,有些
variable是null,代码会尝试访问variable.something。 -
我没有任何代码
-
您是否安装了任何资产?
-
不,我不这么认为,我只是启动了 unity hub 并创建了一个新的 3d 项目