Exemplo n.º 1
0
 private void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.GetComponent <MeteorBehaviour>() != null)
     {
         MeteorBehaviour otherScript = other.gameObject.GetComponent <MeteorBehaviour>();
         otherScript.DamageMe(maxHealth / 2, transform, false);
     }
     if (other.gameObject.GetComponent <PlayerBehaviour>() != null)
     {
         PlayerBehaviour playerScript = other.gameObject.GetComponent <PlayerBehaviour>();
         playerScript.DamageMe(transform, false);
     }
     if (other.gameObject.GetComponent <BulletCheck>() != null)
     {
         BulletCheck bulletScript = other.gameObject.GetComponent <BulletCheck>();
         DamageMe(bulletScript.damage, other.transform, true);
         Destroy(other.gameObject);
     }
 }