Помогите решить проблему кто знает как. Ошибка 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
Содержание
- when i import the standard asset i am getting these problems,
- 6 Ответов
- Ваш Ответ
- Welcome to Unity Answers
- Подписаться на вопрос
- 【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
- Unity 2019.3
when i import the standard asset i am getting these problems,
CheckConsistency: GameObject does not reference component Light. Fixing. CheckConsistency: GameObject does not reference component Animator. Fixing. CheckConsistency: GameObject does not reference component Animator. Fixing. AssetsStandard AssetsUtilityForcedReset.cs(6,27): error CS0619: ‘GUITexture’ is obsolete: ‘GUITexture has been removed. Use UI.Image instead.’ ,
6 Ответов
Ответ от cledan · 12/02/20 14:35
Same issue. Standard Assets seam to not properly work with a version of Unity (at least not with Unity 2019.3.0f6 (64-bit) version)
Ответ от G4M3R72 · 14/02/20 02:39
not working with version 2018.3.7f1 either. I was just using them last night too with no issues.
Ответ от QQQ_QQQ · 06/04/20 13:18
same problem. Anyone?
Ответ от anindoneo · 06/04/20 13:45
Go inside the code and do exactly as it suggests, problem will go away
Ответ от satyamdeo7 · 05/05/20 15:47
The GUI error can be fixed by adding Using UnityEngine.UI and remove GUI from the code for example «GUIText» will become «Text» as for the other errors. I’m also facing them and the t$$anonymous$$ng is the standard assets have way too much problem to work other then there own specified version hence creating these errors tho if you find solutions for others do let me know. @smndey @QQQ_QQQ
Ваш Ответ
Welcome to Unity Answers
If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.
Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.
Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.
Подписаться на вопрос
Ответы Ответы и комментарии
114 пользователей подписаны.
Источник
【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.
Источник
Unity 2019.3
Please Log in or Create an account to join the conversation.
- Frank
- —>
- Offline
- Administrator
- Posts: 1288
- Karma: 79
- Thank you received: 267
Its already compatible with 2019.3.
Please, check if you have the latest version from the Asset Store (I2 Localization 2.8.13 f2)
Hope that helps,
Frank
Please Log in or Create an account to join the conversation.
- jhcom5
- Topic Author —>
- Offline
- User
Yeah 2.8.13 is installed, but I am getting 4 errors, all about GUItext/texture
Assets/I2/Localization/Scripts/Targets/LocalizeTarget_UnityStandard_GUIText.cs(9,72): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead
Assets/I2/Localization/Scripts/Targets/LocalizeTarget_UnityStandard_GUITexture.cs(9,75): error CS0619: ‘GUITexture’ is obsolete: ‘GUITexture has been removed. Use UI.Image instead.’
Please Log in or Create an account to join the conversation.
- manmac
- —>
- Offline
- New Member
Same here. After I updated to the latest version of Unity beta 2019.3 I get the following
Assets/I2/Localization/Scripts/Targets/LocalizeTarget_UnityStandard_GUIText.cs(9,72): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead.’
Assets/I2/Localization/Scripts/Targets/LocalizeTarget_UnityStandard_GUIText.cs(9,18): error CS0311: The type ‘UnityEngine.GUIText’ cannot be used as type parameter ‘T’ in the generic type or method ‘LocalizeTarget ‘. There is no implicit reference conversion from ‘UnityEngine.GUIText’ to ‘UnityEngine.Object’.
Assets/I2/Localization/Scripts/Targets/LocalizeTarget_UnityStandard_GUITexture.cs(9,75): error CS0619: ‘GUITexture’ is obsolete: ‘GUITexture has been removed. Use UI.Image instead.’
Assets/I2/Localization/Scripts/Targets/LocalizeTarget_UnityStandard_GUITexture.cs(9,18): error CS0311: The type ‘UnityEngine.GUITexture’ cannot be used as type parameter ‘T’ in the generic type or method ‘LocalizeTarget ‘. There is no implicit reference conversion from ‘UnityEngine.GUITexture’ to ‘UnityEngine.Object’.
Please Log in or Create an account to join the conversation.
Источник
Search Issue Tracker
Won’t Fix
Found in
2019.3.0a4
2019.3.0a5
«GUI Text» and «GUI Texture» are obsolete and do not get auto-updated in 2019.3.0a4.
Steps to reproduce:
1) Create a new project.
2) Window > Asset store
3) Download and Import project, «2d platformer»
OR
2) Import attached script, «Test.cs»
Actual result: Console throws errors «GUI Text» and «GUI Texture» are obsolete.
Expected result: Autoupdater updates «GUI Text» and «GUI Texture» to UI.Text and UI.Image
Occurs on: 2019.3.0a5, 2019.3.0a4
Works fine on: 2019.3.0a3
Environment: Both Windows and Mac
Stack trace:
AssetsScriptsTest.cs(12,10): error CS0619: ‘GUITexture’ is obsolete: ‘GUITexture has been removed. Use UI.Image instead.’
AssetsScriptsTest.cs(13,10): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead.’
Произошла ошибка
AssetsStandard AssetsUtilityForcedReset.cs(6,27): error CS0619: ‘GUITexture’ is obsolete: ‘GUITexture has been removed. Use UI.Image instead.’
Есть еще один, забыл записать, наверное
Assets Standard Assets Utility SimpleActivatorMenu также имеет эту ошибку, которая также является GUITexture;
Симптомы ошибки
- 2 ошибки появились внизу единицы
- Скрипт не может смонтировать объект, и появляется следующая ошибка:
Решение
Перепечатано по этой ссылке
Первый шаг — изменить скрипт SimpleActivatorMenu.
using System;
using UnityEngine;
using UnityEngine.UI; // Добавить сюда
namespace UnityStandardAssets.Utility
{
public class SimpleActivatorMenu : MonoBehaviour
{
// An incredibly simple menu which, when given references
// to gameobjects in the scene
public Text camSwitchButton; // Изменить здесь
public GameObject[] objects;
......
Второй шаг — изменить скрипт ForcedReset.
using System;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityStandardAssets.CrossPlatformInput;
using UnityEngine.UI; // Добавить сюда
[RequireComponent(typeof (Image))] // Изменить здесь
public class ForcedReset : MonoBehaviour
{
private void Update()
{
// if we have forced a reset ...
if (CrossPlatformInputManager.GetButtonDown("ResetObject"))
{
//... reload the scene
SceneManager.LoadScene(SceneManager.GetSceneAt(0).name);
}
}
}
проблема решена!