Esempio n. 1
0
 private void RunPlayer()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         startWindow.SetActive(false);
         gameStatus = E_GameStatus.Play;
         isRun      = true;
     }
 }
Esempio n. 2
0
 public void RestartGame()
 {
     gameStatus = E_GameStatus.Start;
     gameOverWindow.SetActive(false);
     isRun          = false;
     moneyPlayer    = 0;
     distancePlayer = 0;
     playerObject.SelfTransform.position = startPosition.position;
     mapGenerator.Restart();
 }
Esempio n. 3
0
    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);
        }
    }
Esempio n. 4
0
    public void PauseGame()
    {
        if (gameStatus == E_GameStatus.Pause)
        {
            Time.timeScale = 1f;
            gameStatus     = temp;
            return;
        }

        Time.timeScale = 0;
        temp           = gameStatus;
        gameStatus     = E_GameStatus.Pause;
    }
Esempio n. 5
0
 private void Start()
 {
     gameStatus = E_GameStatus.Start;
     playerObject.onMoneyCollect += TrigerMoney;
 }