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); } } }
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); } } }