Пример #1
0
    // Update is called once per frame
    void Update()
    {
        Text scoreText = GameObject.FindGameObjectWithTag("Score").GetComponent <Text>();

        scoreText.text = "Score: " + score;

        Text brick = GameObject.FindGameObjectWithTag("Aantal").GetComponent <Text>();

        brick.text = "Aantal: " + aantalBricks;

        Text lives = GameObject.FindGameObjectWithTag("LivesText").GetComponent <Text>();

        lives.text = "Lives: " + aantalLives;

        if (aantalBricks == 0)
        {
            LevelControllerScript ls = GameObject.Find("LevelController").GetComponent <LevelControllerScript> ();
            ls.setLevel(1);
            BallScript bs = GameObject.FindGameObjectWithTag("Ball").GetComponent <BallScript> ();
            bs.Die();

            CreateBrick();
        }
    }