Esempio n. 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Projectile")
     {
         ProjectileContoller projectileContoller = other.gameObject.GetComponent <ProjectileContoller>();
         Health -= projectileContoller.GetDamage();
         if (Health <= 0)
         {
             OnHumanDeath(this);
             GameManager.Instance.AddBadAssPoints(BadAssScore);
         }
     }
 }
Esempio n. 2
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         if (collision.relativeVelocity.magnitude > 2.5f)
         {
             OnHumanDeath(this);
             GameManager.Instance.AddBadAssPoints(BadAssScore);
         }
     }
     else if (collision.gameObject.tag == "Projectile")
     {
         ProjectileContoller projectileContoller = collision.gameObject.GetComponent <ProjectileContoller>();
         Health -= projectileContoller.GetDamage();
         if (Health <= 0)
         {
             OnHumanDeath(this);
             GameManager.Instance.AddBadAssPoints(BadAssScore);
         }
     }
 }