using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class SceneController : MonoBehaviour { public static SceneController Instance = null; // this object will always exist! void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); return; } // Make this object stay around when switching scenes 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