Unity Hub导入项目“静夜思”报错error CS0619: ‘GUIText‘ is obsolete: ‘GUIText has been removed. Use UI.Text inst

这篇具有很好参考价值的文章主要介绍了Unity Hub导入项目“静夜思”报错error CS0619: ‘GUIText‘ is obsolete: ‘GUIText has been removed. Use UI.Text inst。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错:cs0619错误,unity
问题
按照控制台报错位置,找到Assets\Standard Assets\Utility\FPSCounter.cs文件,根据提示 ‘GUIText’ is obsolete: 'GUIText has been removed. Use UI.Text instead.'应该是说GUIText被移除了,没有这个了,需要改为替换的UI.Text。图为有问题的代码👇
cs0619错误,unity

解决办法
修改后的代码,将GUITexture改为Text,并按住alt+enter,再弹出的方框中选择using UnityEngine.UI,或者自己手敲也行。如图所示👇
cs0619错误,unity


问题
同样的,按提示修改控制台后面的报错。
按照控制台报错位置,找到Assets\Standard Assets\Utility\SimpleActivatorMenu.cs文件,鼠标放在错误位置,提示GUITexture已经过时了,需要改为替换的UI.Text。如图所示👇
cs0619错误,unity
解决办法
修改后的代码,将GUITexture改为Text,并按住alt+enter,再弹出的方框中选择using UnityEngine.UI,或者自己手敲也行。如图所示👇
cs0619错误,unity
恭喜你,错误已解决!文章来源地址https://www.toymoban.com/news/detail-525701.html

到了这里,关于Unity Hub导入项目“静夜思”报错error CS0619: ‘GUIText‘ is obsolete: ‘GUIText has been removed. Use UI.Text inst的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Unity Hub报错:No valid Unity Editor license found. Please activate your license.

    最近 遇到一个问题,打开高版本时Hub抛出异常:No valid Unity Editor license found. Please activate your license. 首先你必须排除是否登录Unity Hub,并且激活许可证。 目录 方法一:禁用网络(这个可能无效) ​编辑方法二:(亲测有效) 删除此路径下的文件 -Windows系统: C:ProgramDataUnit

    2024年02月04日
    浏览(27)
  • Unity hub打开项目失败,请查看日志 可能的解决方案

    刚开始使用Unity hub可以正常打开项目,之后发现不行了,新建项目之后报错: Unity hub 打开项目失败 请查看日志 之后我开始去网上搜索解决问题的方案,大致的方案有以下几种: 退出重启Unity hub; 退出Unity hub的账号,登录账号重启; 重启电脑(好像都是重新启动的方法);

    2024年02月04日
    浏览(31)
  • Unity Build时Unity 出现error CS0103: The name ‘AssetDatabase‘ does not exist in the current context

    当对unity进行build操作,报了好几条错误 解决方法如下:打开代码提示的代码文件 registerandload,找到使用AssetDatabase的那行, 用下面这两行代码包裹报错的那行代码。 调整结果如下所示: 这样问题就解决了

    2024年02月13日
    浏览(33)
  • 打开项目出现报错:An error occurred while resolving packages: Project has invalid dependencies: com.unity.

    最近做unity项目,git pull别人的项目,打开后出现这样的报错: An error occurred while resolving packages: Project has invalid dependencies: com.unity.visualeffectgraph: Package [com.unity.visualeffectgraph@12.1.10] cannot be found A re-import of the project may be required to fix the issue or a manual modification of ... 翻译是: 解析

    2024年02月12日
    浏览(38)
  • 【unity】error CS0246: The type or namespace name ‘xxx‘ could not be found

    可能性一: VScode中各项目的目标框架不一致。通过菜单栏“项目-属性-应用程序-目标框架”,可以检查各目标框架是否一致 是否有效:并没有 补充:如果无法打开这个窗口,可能是由于vs将访问项目属性默认设置为了false。可以通过菜单栏的“工具-选项-使用unity的工具-访问

    2024年02月11日
    浏览(32)
  • Unity 出现error CS0103: The name ‘AssetDatabase‘ does not exist in the current context

    在Unity场景中,在进行build操作时出现这种报错,导致资源bundle无法正常生成,出现以下问题: error CS0103: The name \\\'AssetDatabase\\\' does not exist in the current context error CS0234: The type or namespace name \\\'AssetDatabase\\\' does not exist in the namespace \\\'UnityEditor\\\' (are you missing an assembly reference?) ps :上面两种

    2023年04月09日
    浏览(37)
  • Unity2022里用ViusalStudio2019创建代码报错CS8032 C# 无法从 {1}: {2} 创建分析器实例 {0}。

    用Unity2022在vs2019里创建脚本时遇到了CS8032 问题 首先在Assets文件下创建一个名为CS8032WarningFixer的脚本   在脚本里输入这些代码  using System.Linq; using System.Xml.Linq; using UnityEditor; public class CS8032WarningFixer : AssetPostprocessor {     private static string OnGeneratedCSProject(string path, string content

    2024年02月16日
    浏览(58)
  • ASL单芯片CS5366TypeC转HDMI4K60HZ加HUB多口方案|CS5366带PD拓展方案原理图

    CS5366芯片是ASL集睿致远最新推出的2Len带PD的扩展坞方案芯片,CS5366支持4K60HZ。 在分辨率 4K下,刷新率60HZ对于30HZ看似提升不多,但是对于应用在游戏主座的客户来说至关重要,现在年轻一代消费力强,也注重享受和体验,博主自己也打游戏,相信大家都知道流畅度的重要性。

    2024年02月12日
    浏览(36)
  • unity error CS0246: The type or namespace name ‘xxx‘ could not be found (are you missing a using

    unity 导入了Bitmap使用后报错: error CS0246: The type or namespace name ‘XXX’ could not be found (are you missing a using directive or an assembly reference?) 解决方案如下: .NET Standard 2.1与 .NET Foundation 发布的 .NET Standard 2.1 配置文件匹配。 Unity 建议新项目使用 .NET Standard 2.1。 它比 .NET 4.x 小,有利于尺

    2024年04月26日
    浏览(29)
  • Unity导入Goolgle.Protobuf.dll报错

    描述:在直接导入Google.Protobuf.dll时会出现以下两个报错信息 1.Assembly ‘Library/ScriptAssemblies/Assembly-CSharp.dll’ will not be loaded due to errors: Reference has errors ‘Google.Protobuf’. 2.Assembly ‘Assets/Plugins/Google.Protobuf.dll’ will not be loaded due to errors: Unable to resolve reference ‘System.Runtime.Compiler

    2024年02月12日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包