Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(12,16): error CS0619: 'GUIText' is obsolete: '

Discussion in 'Editor & General Support' started by Manif3st, Aug 23, 2020.

  1. Manif3st

    Manif3st

    Joined:
    Jan 9, 2020
    Posts:
    5
    i downloaded the standard assets from the store and now i get this error msg:Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(12,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' im not sure how to fix this. heres all the code.


    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 GUIText 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.SetActive(i == nextactiveobject);
    }

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

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
  3. Ghxstly-Lord_GhxstGames

    Ghxstly-Lord_GhxstGames

    Joined:
    Dec 25, 2021
    Posts:
    1