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.gameObject); 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 (scene.buildIndex == 0) { // if this is the menu GameObject.Find("NewGameButton").GetComponent