using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class SceneController : MonoBehaviour { // this object will always exist! void Awake() { // check to see if a state controller already exists if (GameObject.FindGameObjectWithTag("SceneManager") != null) { Destroy(this.gameObject); } else { // if it doesn't, then this is the only one this.gameObject.tag = "SceneManager"; } DontDestroyOnLoad(this.gameObject); SceneManager.sceneLoaded += OnSceneLoaded; } void OnSceneLoaded(Scene scene, LoadSceneMode mode) { GameObject pauseMenu = GameObject.Find("PauseMenuCanvas"); if (pauseMenu != null) { Button quitButton = GameObject.Find("QuitButton").GetComponent