예제 #1
0
    public void OnTriggerEnter(Collider other)                                          //Called when the ball enters the zone
    {
        BallControl ballControl = other.GetComponent <BallControl>();                   //Get the ball control

        if (ballControl)
        {
            ballControl.Die();                                                          //Destroy the ball and respawn
            pongManager.lives--;                                                        //Update the manager
        }
    }