Answers for "error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'"

7

error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'

/*Add at the beginning of the code:*/
using UnityEngine.UI;
/*then replace GUIText with Text*/
Posted by: Guest on November-06-2020
2

how to solve error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'

/*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.*/
Posted by: Guest on November-11-2020
0

guitext is obsolete use ui.text instead

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;
        }
    }
}
Posted by: Guest on May-13-2021

Code answers related to "error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'"

Browse Popular Code Answers by Language