예제 #1
0
    void OnTriggerEnter(Collider other)
    {
        BallScript ballScript = other.GetComponent <BallScript>();

        if (ballScript)
        {
            ballScript.Die();
        }
    }
예제 #2
0
    private void OnTriggerEnter(Collider other)
    {
        BallScript ballScript = other.GetComponent <BallScript>();

        if (ballScript)
        {
            ballScript.Die();
        }
        Debug.Log("LifeLost");
    }
예제 #3
0
    void OnTriggerEnter(Collider other)
    {
        BallScript bs = other.GetComponent <BallScript> ();


        if (bs)
        {
            bs.Die();
            bs.DieForReal();
        }
    }
예제 #4
0
    //If the ball misses the paddle the ball needs to be destroyed
    void OnTriggerEnter(Collider other)
    {
        //Getting the script component from the ball when it collides
        BallScript ballScript = other.GetComponent <BallScript>();

        // call the die function
        if (ballScript)
        {
            ballScript.Die();
        }
    }
예제 #5
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();
        }
    }