private IEnumerator CoEndLevel() { foreach (var player in Players) { player.PlayerInControl = false; player.PlayerIsInvulnerable = true; } AudioPlayer.Instance.PlayUISound("cine_missionwin"); var splashGO = Instantiate(CoreUtils.LoadResource <GameObject>("UI/MissionEndSplash"), CoreUtils.GetUIRoot()); var splash = splashGO.GetComponent <MissionStartSplashController>(); splash.SetupSplash(EndWaitTime, SplashText, EndSplashSound); ScreenFader.FadeTo(Color.black, 5f, false, false, false); for (float elapsed = 0; elapsed < 1f; elapsed += Time.deltaTime) { AudioPlayer.Instance.SetMusicVolume(1f - (elapsed / 1f), MusicSlot.Ambient); //fade out music yield return(null); } yield return(new WaitForSeconds(Mathf.Max(EndWaitTime - 1f, 1f))); //end level SharedUtils.EndGame(); }
public void HandleExitButtonClicked() { //exit the game Time.timeScale = ConfigState.Instance.DefaultTimescale; //needed? //BaseSceneController.Current.("MainMenuScene"); SharedUtils.EndGame(); }
public static void TestScreenFader() { AsyncUtils.RunWithExceptionHandling(async() => { ScreenFader.FadeTo(Color.white, 5.0f, true, true, true); await Task.Delay(6000); AsyncUtils.ThrowIfEditorStopped(); SharedUtils.ChangeScene("TestScene"); await Task.Delay(5000); AsyncUtils.ThrowIfEditorStopped(); ScreenFader.FadeFrom(null, 1.0f, false, true, true); await Task.Delay(5000); AsyncUtils.ThrowIfEditorStopped(); ScreenFader.Crossfade(Color.blue, Color.red, 5.0f, false, false, false); await Task.Delay(3000); AsyncUtils.ThrowIfEditorStopped(); ScreenFader.ClearFade(); await Task.Delay(5000); AsyncUtils.ThrowIfEditorStopped(); ScreenFader.Crossfade(Color.blue, Color.red, 5.0f, false, false, false); await Task.Delay(1000); AsyncUtils.ThrowIfEditorStopped(); SharedUtils.ChangeScene("TestScene"); await Task.Delay(5000); AsyncUtils.ThrowIfEditorStopped(); ScreenFader.FadeTo(Color.black, 1.0f, true, false, true); await Task.Delay(1500); AsyncUtils.ThrowIfEditorStopped(); SharedUtils.EndGame(); }); }
public void HandleReloadButtonClicked() { string saveName = SaveUtils.GetLastSave(); if (string.IsNullOrEmpty(saveName)) { Modal.PushConfirmModal("There is no previous save to load", "Save Not Found", "Main Menu", "Close", null, (status, tag, result) => { if (result) { SharedUtils.EndGame(); } }); } else { SharedUtils.LoadGame(saveName, false); } }
public void OnClickExit() { Time.timeScale = ConfigState.Instance.DefaultTimescale; //needed? //BaseSceneController.Current.(CoreParams.MainMenuScene); SharedUtils.EndGame(); }
public void HandleExitButtonClicked() { //clear data and continue SharedUtils.EndGame(); }
public void OnClickContinue() { //clear data and continue SharedUtils.EndGame(); }
static void EndGame() { SharedUtils.EndGame(); }