Problem:
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
Solution:
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
Solution:
-- so here is my solution
- in both SimpleActivatorMenu.cs and ForcedReset.cs paste the following at the top "using UnityEngine.UI;"
- where the originally suggested changes from GUITexture to UI.Texture and GUIText to UI.Text, I just removed the UI, as in the post link above!
now my game mode will play!!!
Search for SimpleActivatorMenu.cs
And change the code to this below.
I had this error today.
I added:
using UnityEngine.UI;
and then changed:
public GUIText camSwitchButton;to:
public Text camSwitchButton;
==================================================================
//ForcedReset.csusing System;using UnityEngine;using UnityEngine.SceneManagement;using UnityStandardAssets.CrossPlatformInput;using UnityEngine.UI;//change GUITexture to Image[RequireComponent(typeof (Image))]public class ForcedReset : MonoBehaviour{private void Update(){// if we have forced a reset ...if (CrossPlatformInputManager.GetButtonDown("ResetObject")){//... reload the sceneSceneManager.LoadScene(SceneManager.GetSceneAt(0).name);}}}////////////////////////////////////SimpleActivatorMenu.csusing System;using UnityEngine;using UnityEngine.UI;namespace UnityStandardAssets.Utility{public class SimpleActivatorMenu : MonoBehaviour{//// change GUIText to TEXTpublic Text camSwitchButton;public GameObject[] objects;private int m_CurrentActiveObject;private void OnEnable(){// active object starts from first in arraym_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;}}}
0 Comments