Unity 报错之 The type or namespace name ‘UI‘ does not exist in the namespace ‘UnityEngine‘
发布日期:2021-06-29 19:10:18 浏览次数:3 分类:技术文章

本文共 767 字,大约阅读时间需要 2 分钟。

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’(你缺少一个程序集引用?)

1.1

解决问题:

在工程中导入UI程序集步骤如下:

“Window” – “Package Manager” – “Unity UI” --> “Install”
1.2

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


其他问题:

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 ,方式如下:

同样类似的问题的话,都根据提示进行导入相关的模块就可以了。

1.3


转载地址:https://czhenya.blog.csdn.net/article/details/115015504 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:VS 显示方法引用的设置方法
下一篇:写好代码的七条好习惯

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月18日 03时01分49秒