类型或命名空间名称 'UI'不存在于命名空间 'UnityEngine' [英] The type or namespace name 'UI' does not exist in the namespace 'UnityEngine'

查看:40
本文介绍了类型或命名空间名称 'UI'不存在于命名空间 'UnityEngine'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为初学者开设一门关于 Unity 3D 的小型课程 这里.在从统一资产商店导入所有资产后,如课程中所述,我收到一个可能不应该生成的错误,内容为:

I am doing a small course for beginners about Unity 3D here. After importing all the assets from the unity asset store, as explained in the course, I get an error that probably shouldn't be generated, that says:

命名空间 UnityEngine 中不存在类型或命名空间名称UI"

The type or namespace name 'UI' does not exist in the namespace UnityEngine

我已经搜索过这个问题,但我只从旧版本的 Unity 中找到了答案.正如某些人所说,我尝试重新导入所有资产关闭并重新打开统一,但这两种方式似乎都不适合我.

I have already searched for this problem but I have only found answers from older versions of Unity. I tried, as some said, to reimport all the assets and to close and re-open unity but both ways seem to not work for me.

这是 ChinemachineStoryboard 文件中的第一行代码,编译器指出:public UnityEngine.UI.RawImage mRawImage;

This is the first line of code from the ChinemachineStoryboard file, that the compiler indicates: public UnityEngine.UI.RawImage mRawImage;

第二个(第 32 行)只是一个注释,所以我不明白它会如何影响任何事情,但以防万一,这里是:///

如有必要,图像将被裁剪以完全填满屏幕

The second one (line 32) is just a comment so i don't understand how it could affect anything, but just in case, here it is: /// <summary>Image will be cropped if necessary so that the screen is entirely filled</summary>

推荐答案

首先 Unity 2019.3.0a4Alpha 版本.您可以在版本中的 a 上看到这一点.b 将是一个 Beta 版本,但在生产环境中仍不稳定.

First of all Unity 2019.3.0a4 is an Alpha version. You can see this on the a in the version. b would be a Beta version which still isn't stable for production.

简而言之:请勿使用 Alpha 或 Beta 版本进行生产.它们不稳定并且充满了错误和错误.您应该只将它们用于测试绝对最新的功能......并且用于测试.这就是拥有 alpha 和 beta 版本的全部目的.

In short: Don't use alpha or beta versions for production. They are not stable and full of bugs and errors. You should only use them for testing the absolutely newest features .. and only for that. That's the whole purpose of having alpha and beta versions.

而是坚持使用最新的稳定版本!您可以在版本中的 f 上识别它们.目前是 2019.3.0f1

Rather stick to the latest stable versions! You can recognize them on the f in the version. Currently it is 2019.3.0f1

这里的具体原因是,在较新的 Unity 版本中,整个 UI 和编辑器 GUI 已完全更新,现在旧版"UnityEngine.UI 移至 PackageManager ...因此命名空间很简单如果根据 UI 包 不存在,则不再存在为您的项目安装.

The reason here in specific is that in the newer Unity versions the entire UI and Editor GUI was completely renewed and the now "legacy" UnityEngine.UI moved to a package in the PackageManager ... thus the namespace simply doesn't exist anymore if the according UI Package is not installed for your project.

这篇关于类型或命名空间名称 &amp;#39;UI&amp;#39;不存在于命名空间 &amp;#39;UnityEngine&amp;#39;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆