Пример #1
0
 private void Update()
 {
     if (!gameActive && (Input.GetKeyDown(KeyCode.Space)))
     {
         gameActive = true;
         ballController.ActivateBall(true);
     }
     else if (!gameOver && (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P)))
     {
         MenuManager.instance.PauseGame(pauseScreen);
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) && !gameActive)
        {
            theBall.ActivateBall();
            gameActive = true;
        }

        if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P))
        {
            if (pauseScreen.activeSelf)
            {
                pauseScreen.SetActive(false);
                Time.timeScale = 1f;
            }
            else
            {
                pauseScreen.SetActive(true);
                Time.timeScale = 0;
            }
        }
        var brickCheck = FindObjectOfType <BrickController>();

        if (brickCheck == null)
        {
            PlayerPrefs.SetInt("currentScore", currentScore);
            PlayerPrefs.SetInt("highScore", currentHiScore);
            levelWin.SetActive(true);
            Time.timeScale = 0f;
        }
    }
Пример #3
0
 void ShootingDone()
 {
     shootingBall.transform.position = transform.position;
     currentBallController.ActivateBall(shootingBall.color, shootingBall.number);
     shootingBall.InitAmo();
     isShootAllowed = true;
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space) && !gameActive)
     {
         theBall.ActivateBall();
         gameActive = true;
     }
 }