Hi,
My Unity Editor(2019.4.11f1) keeps crashing after I use a button in my scene. Now I don't know why but I'm pretty sure it has to do something with my Game Manager. I also tried using another version of the editor but I get the same problem.
Here is my Game Manager Script:
public class GameManager : MonoBehaviour
{
public TextMeshProUGUI CounterText;
public TextMeshProUGUI scoreText;
private int turn = 0;
public static int score;
public int scoreValue;
public bool isGameActive;
public GameObject titleScreen;
private void Start()
{
turn = 0;
}
private void OnTriggerEnter(Collider other)
{
turn += 1;
CounterText.text = "Turn : " + turn + "/3";
score += scoreValue;
scoreText.text = "score: " + score;
}
public void startGame()
{
isGameActive = true;
score = 0;
turn = 0;
titleScreen.gameObject.SetActive(false);
}
}
Here is the Game Manager's Inspector:
![alt text][1]
I'm making a title screen that i want to deactivate as soon as I click the start button, when I click the button the whole editor freezes. Can anyone make out what is causing that.
I'll add the script for my button as well just in case:
public class StartButton : MonoBehaviour
{
private Button button;
private GameManager counterScript;
// Start is called before the first frame update
void Start()
{
button = GetComponent
↧