// on Start, bind all buttons to their respective scenes and call DontDestroyOnLoad to keep the Main Menu in every scene void Start() { DontDestroyOnLoad(gameObject); BindButtonsToScenes(); m_menuToggleAudio = GetComponent <AudioSource>(); // For binding TextMeshPro to GUI on the screen questionText = questionText.GetComponent <TextMeshProUGUI>(); // Load initial menu components and then hide it DisplayMain(); m_menu.SetActive(!m_menu.activeInHierarchy); Debug.Log("Opening Ports"); // Add relevant components ReaperManager ReaperManager = gameObject.AddComponent <ReaperManager>(); //MultiChoiceQns MultiChoiceQns = gameObject.AddComponent<MultiChoiceQns>(); ReaperManager.instance.OpenPort(); //openPorts(); StartCoroutine("UpdateAudio"); }
void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } }