private void RunPlayer() { if (Input.GetKeyDown(KeyCode.Space)) { startWindow.SetActive(false); gameStatus = E_GameStatus.Play; isRun = true; } }
public void RestartGame() { gameStatus = E_GameStatus.Start; gameOverWindow.SetActive(false); isRun = false; moneyPlayer = 0; distancePlayer = 0; playerObject.SelfTransform.position = startPosition.position; mapGenerator.Restart(); }
private IEnumerator EndGame() { if (!isRun && gameStatus == E_GameStatus.Play) { gameStatus = E_GameStatus.End; yield return(new WaitForSeconds(1)); gameOverWindow.SetActive(true); DataManager.EndGame(moneyPlayer, distancePlayer); } }
public void PauseGame() { if (gameStatus == E_GameStatus.Pause) { Time.timeScale = 1f; gameStatus = temp; return; } Time.timeScale = 0; temp = gameStatus; gameStatus = E_GameStatus.Pause; }
private void Start() { gameStatus = E_GameStatus.Start; playerObject.onMoneyCollect += TrigerMoney; }