Exemplo n.º 1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("Penguin"))
     {
         penguinManagerComponent.CountPenguin(1, true);
     }
 }
Exemplo n.º 2
0
    public void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("PenguinKiller"))
        {
            bloodSplatt.Play();
            deathScream.Play();
            penguCollider.enabled = false;
            penguRenderer.enabled = false;
            penguinManagerComponent.CountPenguin(1, true);
            Destroy(this.gameObject, 2f);
        }

        if (collision.gameObject.CompareTag("PenguinGoal"))
        {
            PortalSound.Play();
            penguinManagerComponent.CountPenguin(1, false);
            Destroy(this.gameObject);
        }
    }