Unity 报错之 The type or namespace name 'UI' does not exist in the namespace 'UnityEngine'

产生报错:

之前使用Unity2017版本开发的工程,误用Unity2019版本打开了,报错如下:

The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
类型或命名空间名称'UI'不存在命名空间'UnityEngine'(你缺少一个程序集引用?)

Unity 报错之 The type or namespace name 'UI' does not exist in the namespace 'UnityEngine'

解决问题:

在工程中导入UI程序集步骤如下:
“Window” -- "Package Manager" -- "Unity UI" --> "Install"
Unity 报错之 The type or namespace name 'UI' does not exist in the namespace 'UnityEngine'

导入成功后,解决已错误。


其他问题:

The type name 'MeshCollider' could not be found in the namespace 'UnityEngine'. This type has been forwarded to assembly 'UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'Physics' in the Package Manager window to fix this error.

根据上文提示:需要导入 UnityEngine.PhysicsModule ,方式如下:
同样类似的问题的话,都根据提示进行导入相关的模块就可以了。

Unity 报错之 The type or namespace name 'UI' does not exist in the namespace 'UnityEngine'


上一篇:手机应用与PC程序测试相比侧重点--博文《要考虑》中问题2的答案整理


下一篇:mac电脑jdk版本切换