Пример #1
0
 void Awake()
 {
     SP = this;
     gameState = PinballGameState.playing;
     Time.timeScale = 1.0f;
     SpawnBall();
 }
 void Awake()
 {
     SP             = this;
     gameState      = PinballGameState.playing;
     Time.timeScale = 1.0f;
     SpawnBall();
     SetNewTime();
     SetScoreText();
     winText.text = "";
 }
    public void LostBall()
    {
        int ballsLeft = GameObject.FindGameObjectsWithTag("Player").Length;

        if (ballsLeft <= 1)
        {
            //Was the last ball..
            //SetGameOver();
            gameState = PinballGameState.lost;
        }
    }
Пример #4
0
    void Awake()
    {
    	// Save pause menu object and hide
		pauseMenu = GameObject.Find ("Pause Panel");
		pauseMenu.SetActive(false);

		numObjects = GameObject.FindGameObjectsWithTag ("Bumper").Length;

        SP = this;
        gameState = PinballGameState.playing;
        Time.timeScale = 1.0f;
        SpawnBall();
    }
    void SetScoreText()
    {
        scoreCount.text = "Score: " + score.ToString();
        if (score == 2000)
        {
            winText.text = "YOU WIN!";
            gameState    = PinballGameState.won;
            StartCoroutine("wait");
        }

        if (gameState == PinballGameState.lost)
        {
            winText.text = "YOU LOSE!";
            StartCoroutine("wait");
        }
    }
Пример #6
0
 public void SetGameOver()
 {
     Time.timeScale = 0.0f; //Pause game
     gameState = PinballGameState.lost;
 }
Пример #7
0
 public void WonGame()
 {
     Time.timeScale = 0.0f; //Pause game
     gameState = PinballGameState.won;
 }
 public void WonGame()
 {
     Time.timeScale = 0.0f; //Pause game
     gameState      = PinballGameState.won;
 }