Error in Standard Assets
Hi.
Just started a new project, downloaded an imported the Standard Assets from the asset store.
So, unity version: 2019.3.7f1 Personal Standard Assets version: 1.1.5 released March 5, 2018
And I get the error message:
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
Double clicking the error message brings me to this chunk of code:
using System;
using UnityEngine;
#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[i].SetActive(i == nextactiveobject);
}
m_CurrentActiveObject = nextactiveobject;
camSwitchButton.text = objects[m_CurrentActiveObject].name;
}
}
}
How do I fix this so I can actually start placing and programming assets for my game?
Or, do I need to abandon the Standard Assets entirely as being useless?
Answer by sdadfsfg · Aug 11, 2020 at 11:10 AM
Olá faça isso
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;
Your answer
Follow this Question
Related Questions
How to call Animator from another script 0 Answers
Text Editors 0 Answers
Character swap breaks movement. 1 Answer
help! i am a newbie here and i got a problem in scripting 0 Answers