Помогите решить проблему кто знает как. Ошибка CS0619
, незнаю что делать.
AssetsStandard AssetsUtilitySimpleActivatorMenu.cs(10,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
aepot
42.3k5 золотых знаков17 серебряных знаков48 бронзовых знаков
задан 7 авг 2020 в 7:04
5
Написано же что устарела GUITexture
и GUITex
используйте UI.Image
и UI.Image.Text
ответ дан 7 авг 2020 в 7:26
Aziz UmarovAziz Umarov
22.3k2 золотых знака9 серебряных знаков31 бронзовый знак
Сначала подключи UnityEngine.UI и замени где GUIText на Text
ответ дан 26 янв 2021 в 2:55
Introduction
In this article we will see how to solve the error «GUIText is obsolete» in Unity, an error that started to occur several versions ago because the GUIText programming class was replaced by another one and there are still many Unity packages using the previous version.
ABOUT THIS VIDEO
In this video we see how I solve this error that appears when importing the Standard Assets package. This is an error that is simple to solve but it is important that you understand why it occurs and what to do, since the error can occur in countless cases, you will have to identify how to do it in your particular case.
HERE MY UNITY PLAYLIST
👇🏽
Steps to solve «GUIText is obsolete» in Unity
1. Open all the scripts that contain this error. Help yourself with the error information in Unity’s console (clicking on the error will give you some extra information), the console will tell you the name of the script and the error line. If we double-click on the error, the script will open and the error line will be highlighted.
2. It is necessary to replace the use of the «GUIText» fields by the «UnityEngine.UI.Text» class. That is, where we see that «GUIText» is used (case sensitive), delete it and write «UnityEngine.UI.Text» instead.
3. Save the script and verify in the console that the error disappears.
Optional: The prefix «UnityEngine.UI» can be included in the script header, that way we can refer to the component directly as «Text». See lines 3 and 12 in figure 4.
CHECK OUT THIS CRAZY EXPERIMENT
Содержание
- 【Unity】The way to fix error CS0619:’GUIText’ is obsolete:’GUIText has been removed. Use UI.Text instead.’
- Overview
- Environment
- Occurences
- The way to fix it
- AssetsStandard AssetsUtilitySimpleActivatorMenu.cs(11,16): error CS0246: The type or namespace name ‘UI’ could not be found (are you missing a using directive or an assembly reference?)
【Unity】The way to fix error CS0619:’GUIText’ is obsolete:’GUIText has been removed. Use UI.Text instead.’
Table of Contents
Overview
There occured error CS0619:’GUIText’ is obsolete:’GUIText has been removed. Use UI.Text instead.’ to use Standard Assets. This article shows a way to fix it.
Environment
Occurences
Making C# script from Assets > Create > C# Script .
Attaching the script to Sphere object by drag & drop, I get message ‘Can’t add script’ .
This massage warns that the name of the script is different from its class name or there are some error of compiling. But I don’t find any error for compiling or the difference of the names.
Now, finding these GUIText error in console tab.
The way to fix it
Double-clicking the error in the console tab then the script “SimpleActivatiorMenu.cs” is opended.
Change it like following.
Addition : using UnityEngine.UI;
Comment out : public GUIText camSwitchButton;
Addition : public Text camSwitchButton;
This is a sample code fixed.
After changing codes and save it, the script can be attached to the Sphere Objects.
Источник
AssetsStandard AssetsUtilitySimpleActivatorMenu.cs(11,16): error CS0246: The type or namespace name ‘UI’ could not be found (are you missing a using directive or an assembly reference?)
So I am getting t$$anonymous$$s error:
AssetsStandard AssetsUtilitySimpleActivatorMenu.cs(11,16): error CS0246: The type or namespace name ‘UI’ could not be found (are you missing a using directive or an assembly reference?)
When I googled it, I ended up referred to t$$anonymous$$s article:
w$$anonymous$$ch recommends adding:
to SimpleActivatorMenu.cs and ForcedReset.cs
It also links to t$$anonymous$$s article:
So I follow those steps, as listed there, and when I attempt to test run, the following error appears:
PlayerSettings Validation: Requested build target group (20) doesn’t exist; #define symbols for scripting won’t be added. UnityEditor.PlayerSettings:SetScriptingDefineSymbolsForGroup(BuildTargetGroup, String) UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize:SetEnabled(String, Boolean, Boolean) (at Assets/Standard Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs:127) UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize:.cctor() (at Assets/Standard Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs:22) UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])
I should also note that t$$anonymous$$s happened after I upgraded to 2019.3.0f6 and imported the Standard Assets from the Unity Store.
Источник
using UnityEngine.UI; — как исправить ошибку?
Приветствую, что мне надо сделать что быч это исправить? AssetsFPS Kit 3.0ScriptsPlayerPlayerNetwork.cs(23,9): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead.’
Я понимаю что он устарел, но что сделать? Unity 2020
Последний раз редактировалось daniilkas123 28 дек 2019, 22:45, всего редактировалось 1 раз.
- daniilkas123
- UNец
- Сообщения: 34
- Зарегистрирован: 04 дек 2019, 01:21
Re: Как изменить/удалить GUITEXT
1max1 28 дек 2019, 22:27
что сделать?
Use UI.Text instead.
-
1max1 - Адепт
- Сообщения: 5285
- Зарегистрирован: 28 июн 2017, 10:51
Re: Как изменить/удалить GUITEXT
daniilkas123 28 дек 2019, 22:32
1max1 писал(а):
что сделать?
Use UI.Text instead.
AssetsFPS Kit 3.0ScriptsPlayerPlayerNetwork.cs(23,9): error CS0246: The type or namespace name ‘UI’ could not be found (are you missing a using directive or an assembly reference?)
using UnityEngine.UI; — добавлено, но все равно
Перевел так же все понял только одно что тип не найден, а хотя у меня есть это
Используется csharp
public UI.Text nameLabel;
public UI.Text nameLabelShadow;
- daniilkas123
- UNец
- Сообщения: 34
- Зарегистрирован: 04 дек 2019, 01:21
Re: using UnityEngine.UI; — как исправить ошибку?
1max1 28 дек 2019, 23:47
Используется csharp
using UnityEngine.UI;
//
public Text nameLabel;
Или сразу:
Используется csharp
public UnityEngine.UI.Text nameLabel;
-
1max1 - Адепт
- Сообщения: 5285
- Зарегистрирован: 28 июн 2017, 10:51
Вернуться в Общие вопросы
Кто сейчас на конференции
Сейчас этот форум просматривают: GoGo.Ru [Bot], Yandex [Bot] и гости: 17
Всем доброго времени суток, столкнулся с ошибками компилятора, это обычное дело для стандартных ассетов юнити. Ошибки по SimpleActivatorMenu и Forced я исправил, но есть еще две ошибки, инфу про них в интернете найти не смог, так что надеюсь, что вы поможете. Вот ошибки:
AssetsStandard AssetsUtilityFPSCounter.cs(7,31): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead.’
AssetsStandard AssetsUtilityFPSCounter.cs(15,17): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead.’
Сам скрипт небольшой, если можете тыкните меня в место, которое нужно исправить)
C# | ||
|
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь