guitext is obsolete use ui.text instead code example
Example 1: error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
using UnityEngine.UI;
Example 2: how to solve error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
using UnityEngine. UI;
Example 3: 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
{
public Text camSwitchButton;
public GameObject[] objects;
private int m_CurrentActiveObject;
private void OnEnable()
{
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;
}
}
}
Example 4: 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
{
public Text camSwitchButton;
public GameObject[] objects;
private int m_CurrentActiveObject;
private void OnEnable()
{
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;
}
}
}