Exemple #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();
        }
Exemple #2
0
 public void Resume()
 {
     PauseMenuUI.SetActive(false);
     GameIsPaused = false;
     OnGamePause?.Invoke(GameIsPaused);
     EnviromentAct.Instance.GameIsStarted = true;
 }
Exemple #3
0
 public void Pause()
 {
     PlayerPrefs.Save();
     PauseMenuUI.SetActive(true);
     GameIsPaused = true;
     OnGamePause?.Invoke(GameIsPaused);
     EnviromentAct.Instance.GameIsStarted = false;
 }
Exemple #4
0
        public void SettingsRelease()
        {
            GameIsPaused = true;

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

            if (TimeIsPaused())
            {
                InputCtrl.On();
            }
        }
Exemple #6
0
 /// <summary>
 /// [Framework Method] Send signal to pause game.
 /// </summary>
 void PauseGame()
 {
     try
     {
         OnGamePause.Dispatch(true);
     }
     catch (Exception exception)
     {
         Debug.LogError(exception);
     }
 }
Exemple #7
0
 /// <summary>
 /// [Framework Method] Send signal to resume game.
 /// </summary>
 void ResumeGame()
 {
     try
     {
         OnGamePause.Dispatch(false);
     }
     catch (Exception exception)
     {
         Debug.LogError(exception);
     }
 }
Exemple #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);
        }
Exemple #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
 }
Exemple #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);
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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);
        }
 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();
         }
     }
 }
 public static void GamePause(bool isPaused)
 {
     //string state = isPaused ? "paused" : "unpaused";
     //DebugManager.LogToFile("[OnGamePause] The game has " + state);
     OnGamePause?.Invoke(isPaused);
 }
Exemple #16
0
 public static void RaiseOnPauseGameEvent()
 {
     OnGamePause?.Invoke();
 }
Exemple #17
0
 public void PauseTheGame()
 {
     DebugManager.LogWithColor("Game Has Pause", Color.red);
     OnGamePause?.Invoke();
     _OnGamePause?.Invoke();
 }
Exemple #18
0
 private void SetPause(bool isPause)
 {
     _pausePanel.SetActive(isPause);
     OnGamePause?.Invoke(this, isPause);
 }
Exemple #19
0
 public void GamePause()
 {
     OnGamePause?.Invoke();
 }