Exemplo n.º 1
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Ball")
        {
            ballSpawner.BallDestroyedNotification(other.gameObject);
            Destroy(other.gameObject);
            destroyedBalls++;
            if (destroyedBalls == ballsInGame)
            {
                endGame.SetActive(true);
                Time.timeScale = 0;
                winSound.Play();
            }
        }

        if (other.gameObject.tag == "Player")
        {
            player.Dead();
        }
    }