guitext is obsolete use ui.text instead

/*Add at the beginning of the code:*/
using UnityEngine.UI;
/*then replace GUIText with Text*/

4.5
4
Awgiedawgie 440220 points

                                    Replace This Script with simple Activator Menu

using System;
using UnityEngine;
using UnityEngine.UI;
#pragma warning disable 618
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;


        private int m_CurrentActiveObject;


        private void OnEnable()
        {
            // active object starts from first in array
            m_CurrentActiveObject = 0;
            camSwitchButton.text = objects[m_CurrentActiveObject].name;
        }


        public void NextCamera()
        {
            int nextactiveobject = m_CurrentActiveObject + 1 >= objects.Length ? 0 : m_CurrentActiveObject + 1;

            for (int i = 0; i < objects.Length; i++)
            {
                objects[i].SetActive(i == nextactiveobject);
            }

            m_CurrentActiveObject = nextactiveobject;
            camSwitchButton.text = objects[m_CurrentActiveObject].name;
        }
    }
}

4.5 (4 Votes)
0
4
2
Awgiedawgie 440220 points

                                    /*Open the . cs file that Unity is indicating on the error (you can use any text editor for this, even notepad)
Insert*/
using UnityEngine. UI;
/*on the beggining of the . cs file.
Replace GUIText with just Text.*/

4 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(17,36): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(10,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' Severity Code Description Project File Line Suppression State Error CS0619 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' GUITEXT IS OBSOLETE USE UI.TEXT HOW how to fix this error Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(12,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' unity GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' : error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' cs(10,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' .cs(7,27): error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.' Assets/Standard Assets/Utility/SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' GUIText' is obsolete: 'GUIText has been removed. Use UI.Text guitext deprecated \Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' cs0619 'guitext' is obsolete 'guitext has been removed. use ui.text instead.' guitext is obsolete use ui.text instead Assets/Standard Assets/Utility/SimpleActivatorMenu.cs(10,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' guitext is obsolete unity GUITexture guitext' is obsolete 'guitext has been removed. use ui.text instead.' 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' guitexture is obsolete use ui.image instead unity gui text is obsolete GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.' GUITexture has been removed. Use UI.Image instead.' guitext unity guitexture is obsolete guitext to ui.text gui text is obsolete first person camera guitexture libary not work Assets\Standard Assets\Utility\FPSCounter.cs(7,31): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' guitexture has been removed. use ui.image instead fps counter guitexture has been removed. use ui.image instead error cs0619 'guitext' is obsolete use ui.text instead Assets\Assets\Utility\SimpleActivatorMenu.cs(10,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' unity error guitext is obsolete unity 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.' error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' unity guitext unity Unity 2019 error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.' error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.' GUItext error how to fix Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' guitext has been removed. use ui.text instead.' unity guitext is obsolete 'GUIText has been removed. Use UI.Text instead.' Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' unity guitext is obsolete use ui.text instead how to fix this error Assets\Standard Assets\Utility\ForcedReset.cs(5,27): error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.' Assets\Standard Assets\Utility\ForcedReset.cs(6,27): error CS0246: The type or namespace name 'UI' could not be found (are you missing a using directive or an assembly reference?) use ui.image instead gui texture is obsolete gui texture has been removed gui texture is obsolete Gui text error unity gui text is obsolete use ui.text instead how to solve error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' gui text is obsolete GUIText has been removed. Use UI.Text instead. error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source