Пример #1
0
        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);
        }
Пример #2
0
 public void AbortFlight()
 {
     pauseScreen.SetActive(false);
     CanvasCoordinator.SetHudInteractable(false);
     Player.Kill();
     ResetAndGoToShop();
 }
Пример #3
0
 public void MainMenyPlayButton()
 {
     if (PlayerSettings.HasSeenControlsTutorial)
     {
         CanvasCoordinator.GoToUpgradesFromMainMenu();
     }
     else
     {
         StartNewFlight();
     }
 }
Пример #4
0
        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);
            });
        }
Пример #5
0
 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();
     }
 }