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(); }
public void Resume() { PauseMenuUI.SetActive(false); GameIsPaused = false; OnGamePause?.Invoke(GameIsPaused); EnviromentAct.Instance.GameIsStarted = true; }
public void Pause() { PlayerPrefs.Save(); PauseMenuUI.SetActive(true); GameIsPaused = true; OnGamePause?.Invoke(GameIsPaused); EnviromentAct.Instance.GameIsStarted = false; }
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(); } }
/// <summary> /// [Framework Method] Send signal to pause game. /// </summary> void PauseGame() { try { OnGamePause.Dispatch(true); } catch (Exception exception) { Debug.LogError(exception); } }
/// <summary> /// [Framework Method] Send signal to resume game. /// </summary> void ResumeGame() { try { OnGamePause.Dispatch(false); } catch (Exception exception) { Debug.LogError(exception); } }
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); }
/// <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 }
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); }
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; }
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; }
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); }
public static void RaiseOnPauseGameEvent() { OnGamePause?.Invoke(); }
public void PauseTheGame() { DebugManager.LogWithColor("Game Has Pause", Color.red); OnGamePause?.Invoke(); _OnGamePause?.Invoke(); }
private void SetPause(bool isPause) { _pausePanel.SetActive(isPause); OnGamePause?.Invoke(this, isPause); }
public void GamePause() { OnGamePause?.Invoke(); }