public async void ContinueButtonPressed() { if (MusicGameEngine.loadedFromAVG) { var naniCamera = Engine.GetService <ICameraManager>().Camera; naniCamera.enabled = true; var inputManager = Engine.GetService <IInputManager>(); inputManager.ProcessInput = true; if (fail) { if (MusicGameEngine.scriptName_FailLevel != null && MusicGameEngine.label_FailLevel != null) { Goto gtcmd = new Goto(); gtcmd.Path = new NamedString(MusicGameEngine.scriptName_FailLevel, MusicGameEngine.label_FailLevel); await gtcmd.ExecuteAsync(); } } else { if (MusicGameEngine.scriptName_ClearLevel != null && MusicGameEngine.label_ClearLevel != null) { Goto gtcmd = new Goto(); gtcmd.Path = new NamedString(MusicGameEngine.scriptName_ClearLevel, MusicGameEngine.label_ClearLevel); await gtcmd.ExecuteAsync(); } } SceneManager.UnloadSceneAsync(1); return; } if (async != null) { bgm.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); async.allowSceneActivation = true; } }
public async void LoadMainMenu() { if (MusicGameEngine.loadedFromAVG) { // 中途退出算失败 var naniCamera = Engine.GetService <ICameraManager>().Camera; naniCamera.enabled = true; var inputManager = Engine.GetService <IInputManager>(); inputManager.ProcessInput = true; if (MusicGameEngine.scriptName_FailLevel != null && MusicGameEngine.label_FailLevel != null) { Goto gtcmd = new Goto(); gtcmd.Path = new NamedString(MusicGameEngine.scriptName_FailLevel, MusicGameEngine.label_FailLevel); await gtcmd.ExecuteAsync(); } SceneManager.UnloadSceneAsync(1); return; } StartCoroutine(WaitForLoadMainMenuFinished()); }