public void StartNewFlight() { GameState.CoinValue = 1; GameState.DifficultyLevel = 1; Player.State.Refresh(); Player.Revive(); potionEffects.RefreshButtonInteractable(); CanvasCoordinator.SetHudInteractable(true); AudioClipPlayer.FadeFromMenuToInGameMusic(); manaBarConstructor.UpdateManaBarSize(); UnityAction onHudShown = () => { if (PlayerSettings.HasSeenControlsTutorial) { GameState.IsPaused = false; isFlightActive = true; } else { TutorialCoordinator.ActivateTiltTutorial(); } }; CanvasCoordinator.HideMenuesAndShowHud(onHudShown); }
public void AbortFlight() { pauseScreen.SetActive(false); CanvasCoordinator.SetHudInteractable(false); Player.Kill(); ResetAndGoToShop(); }
public void MainMenyPlayButton() { if (PlayerSettings.HasSeenControlsTutorial) { CanvasCoordinator.GoToUpgradesFromMainMenu(); } else { StartNewFlight(); } }
private void ResetAndGoToShop() { isFlightActive = false; const float fadeDuration = 0.4f; AudioClipPlayer.FadeOutInGameMusic(fadeDuration * 0.5f); CanvasCoordinator.FadeOutAndIn(fadeDuration, () => { s_instance.ResetGame(); CanvasCoordinator.HideHudAndShowShopMenu(); AudioClipPlayer.FadeInMenuMusic(fadeDuration * 0.5f); }); }
public static void OnPlayerDeath(bool payRespects = true) { CanvasCoordinator.SetHudInteractable(false); AudioClipPlayer.PlayDeath(); s_instance.cameraShake.Shake(); if (payRespects) { var coroutine = PayRespects(2f, s_instance.ResetAndGoToShop); s_instance.StartCoroutine(coroutine); } else { s_instance.ResetAndGoToShop(); } }