void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(this); } DontDestroyOnLoad(this); }
/// <summary> /// Used for transition between an active level and the main menu. /// </summary> /// <remarks>Loads in single mode.</remarks> public void LoadMainMenu() { MainMenuLoading?.Invoke(); LoadScene(Constants.MainMenuSceneName); }