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

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

问题描述

我正在为初学者开设一门关于Unity 3D的小课程.解决方案

首先Unity 2019.3.0a4 Alpha 版本.您可以在该版本的 a 上看到此内容. b 将是 Beta 版本,对于生产来说仍然不稳定.

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

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


此处的具体原因是,在更新的Unity版本中,整个UI和编辑器GUI都已完全更新,并且现在的旧版" UnityEngine.UI移到了 UI包.

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:

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

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.

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

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>

解决方案

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.

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.

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


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.

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

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