Пример #1
0
        public void ShopRelease()
        {
            GameIsPaused = true;

            OnGamePause?.Invoke(GameIsPaused);

            StartPlatform.SetActive(false);
            MainMenu.SetActive(false);

            SetComponentsFromPlayerActive(false);


            PlayButton.SetActive(false);
            SwipeToPlay.SetActive(false);

            EnviromentAct.Instance.GameIsStarted = false;
            ShopPanel.SetActive(true);


            foreach (Skin skin in Skins.skins)
            {
                skin.Initialize();
            }
            Skins.Blue.bought = true;
            ListOfSkins.LoadBoughtSkins();
        }
Пример #2
0
 public void Resume()
 {
     PauseMenuUI.SetActive(false);
     GameIsPaused = false;
     OnGamePause?.Invoke(GameIsPaused);
     EnviromentAct.Instance.GameIsStarted = true;
 }
Пример #3
0
 public void Pause()
 {
     PlayerPrefs.Save();
     PauseMenuUI.SetActive(true);
     GameIsPaused = true;
     OnGamePause?.Invoke(GameIsPaused);
     EnviromentAct.Instance.GameIsStarted = false;
 }
Пример #4
0
        public void SettingsRelease()
        {
            GameIsPaused = true;

            OnGamePause?.Invoke(GameIsPaused);
            SettingsObj.SetActive(true);
            EnviromentAct.Instance.GameIsStarted = false;
            PlayButton.SetActive(false);
        }
Пример #5
0
        private void Pause()
        {
            Time.timeScale = TimeIsPaused() ? 1 : 0;
            OnGamePause?.Invoke(TimeIsPaused());

            if (TimeIsPaused())
            {
                InputCtrl.On();
            }
        }
Пример #6
0
 /// <summary>
 /// [Framework Method] Send signal to pause game.
 /// </summary>
 void PauseGame()
 {
     try
     {
         OnGamePause.Dispatch(true);
     }
     catch (Exception exception)
     {
         Debug.LogError(exception);
     }
 }
Пример #7
0
 /// <summary>
 /// [Framework Method] Send signal to resume game.
 /// </summary>
 void ResumeGame()
 {
     try
     {
         OnGamePause.Dispatch(false);
     }
     catch (Exception exception)
     {
         Debug.LogError(exception);
     }
 }
Пример #8
0
        public void AchievmentsMenuQuit()
        {
            AchievmentMenu.SetActive(false);
            GameIsPaused = false;

            OnGamePause?.Invoke(GameIsPaused);
            PlayButton.SetActive(true);
            StartPlatform.SetActive(true);
            MainMenu.SetActive(true);
            PlayerObject.SetActive(true);

            SwipeToPlay.SetActive(true);
        }
Пример #9
0
 /// <summary>
 /// Request game pause
 /// </summary>
 /// <param name="pause">true if pause, false if resume</param>
 public void RequestGamePause(bool pause)
 {
     OnGamePause?.Invoke(pause);
     if (pause)
     {
         Time.timeScale = 0;
     }
     else
     {
         Time.timeScale = 1;
     }
     // TODO Game pause
 }
Пример #10
0
        public void ShopQuit()
        {
            GameIsPaused = false;
            OnGamePause?.Invoke(GameIsPaused);

            ShopPanel.SetActive(false);
            PlayButton.SetActive(true);
            StartPlatform.SetActive(true);
            MainMenu.SetActive(true);

            SetComponentsFromPlayerActive(true);


            SwipeToPlay.SetActive(true);
        }
Пример #11
0
        public void AchievmentsMenuRelease()
        {
            AchievementNotification.SetActive(false);
            AchievmentMenu.SetActive(true);
            GameIsPaused = true;

            OnGamePause?.Invoke(GameIsPaused);
            StartPlatform.SetActive(false);
            MainMenu.SetActive(false);
            PlayerObject.SetActive(false);
            PlayButton.SetActive(false);
            SwipeToPlay.SetActive(false);

            EnviromentAct.Instance.GameIsStarted = false;
        }
Пример #12
0
        internal Game(AccelerometerHandlerDelegate accelerometerHandler)
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.IsFullScreen              = true;
            graphics.PreferredBackBufferWidth  = 800;
            graphics.PreferredBackBufferHeight = 480;
            graphics.SupportedOrientations     = DisplayOrientation.Portrait;

            GetAccelerometerVector = accelerometerHandler;
            _onGamePause           = null;
            _onGameResume          = null;

            _currentGameState = GameState.LOADING;
        }
Пример #13
0
        public void SettingsHide()
        {
            SettingsObj.SetActive(false);
            if (GameIsPaused)
            {
                EnviromentAct.Instance.GameIsStarted = false;
                PlayButton.SetActive(true);
                GameIsPaused = false;
            }
            else
            {
                EnviromentAct.Instance.GameIsStarted = true;
                GameIsPaused = false;
            }

            OnGamePause?.Invoke(GameIsPaused);
        }
Пример #14
0
 void OnGameStateChangeHandler(GameState prevGameState, GameState newGameState)
 {
     if (newGameState == GameState.STARTING)
     {
         OnGameStart?.Invoke();
     }
     else if (newGameState == GameState.GAMEOVER)
     {
         OnGameOver?.Invoke();
     }
     else if (newGameState == GameState.PAUSED)
     {
         OnGamePause?.Invoke();
     }
     else if (newGameState == GameState.PLAYING)
     {
         if (prevGameState == GameState.PAUSED)
         {
             OnGameResume?.Invoke();
         }
     }
 }
Пример #15
0
 public static void GamePause(bool isPaused)
 {
     //string state = isPaused ? "paused" : "unpaused";
     //DebugManager.LogToFile("[OnGamePause] The game has " + state);
     OnGamePause?.Invoke(isPaused);
 }
Пример #16
0
 public static void RaiseOnPauseGameEvent()
 {
     OnGamePause?.Invoke();
 }
Пример #17
0
 public void PauseTheGame()
 {
     DebugManager.LogWithColor("Game Has Pause", Color.red);
     OnGamePause?.Invoke();
     _OnGamePause?.Invoke();
 }
Пример #18
0
 private void SetPause(bool isPause)
 {
     _pausePanel.SetActive(isPause);
     OnGamePause?.Invoke(this, isPause);
 }
Пример #19
0
 public void GamePause()
 {
     OnGamePause?.Invoke();
 }