//Set Game Status and apply to ui public void SetGameStatus(GAMESTATUS _status) { if (gameStatus != _status) { gameStatus = _status; } ui_Manager.ChangeByGameStatus(gameStatus); }
Lose() { if (m_gameStatus != GAMESTATUS.None) { return; } m_gameStatus = GAMESTATUS.Lose; SceneManager.LoadScene(1); return; }
// Set Game State public void SetGameState(GAMESTATUS state) { if (state == GAMESTATUS.stopped) { // Call Stop Works StopWorks(); } if (state == GAMESTATUS.running) { RunWorks(); } this.status = state; }
public void Update() { if (GamePlay == GAMESTATUS.GMS_STATRGAME) { GamePlay = GAMESTATUS.GMS_LOGIN; GameUIManager.Instance().CreateFrame(GUIDefine.UIF_LOGINFRAME, true); } if (GamePlay == GAMESTATUS.GMS_LOGIN) { } GameUIManager.Instance().Update(); }
//Change the screen as game status public void ChangeByGameStatus(GAMESTATUS _gameStatus) { foreach (UIObject _screen in screens) { if (_screen.GameStatus == _gameStatus) { _screen.SetVisibility(true); activeScreen = _screen; } else { _screen.SetVisibility(false); } } }
private void GamePauseToogle(GAMESTATUS gm) { gameLayerStatus = gm; switch (gameLayerStatus) { case GAMESTATUS.PAUSED: Time.timeScale = 0; System.GC.Collect(); break; case GAMESTATUS.RUNNING: Time.timeScale = 1; break; default: break; } }
public void init() { // Es Dia m_fase = FASEDIA.dia; // Tiempo es 0 m_time = 0; // Tiempo de las 6pm m_sixpm = MAX_TIME * 0.5f; // Tiempo de las 9pm m_ninepm = MAX_TIME - (MAX_TIME * 0.2f); // Game Status init m_gameStatus = GAMESTATUS.None; // Game Paused. m_paused = true; }
/// <summary> /// 切换游戏状态 /// </summary> /// <param name="status">状态枚举值</param> public void ChangeGameStatus(GAMESTATUS status) { m_GameStatus = status; if (m_GameStatus == GAMESTATUS.GAMESTART) { m_isWin = false; m_GameOver.SetActive(false); //m_Player.SetActive(true); m_GameController.GameStart(); CreatePlayer(); ShowScore(); } else if (m_GameStatus == GAMESTATUS.GAMEEND) { //m_Player.SetActive(false); m_GameOver.SetActive(true); m_score = 0; GameObject go = GameObject.FindWithTag("Player"); if (go != null) { Destroy(go.gameObject); } } if (m_isWin) { m_GameWin.SetActive(true); m_GameLose.SetActive(false); } else { m_GameWin.SetActive(false); m_GameLose.SetActive(true); } }
void Awake() { gameStatus = GAMESTATUS.START; //gameStatus = GAMESTATUS.PLAY; }