private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("Bullet")) { BulletScript bulletScript = other.gameObject.GetComponent <BulletScript>(); switch (bulletScript.ReturnBulletType()) { case BulletScript.BulletType.Minigun: HealthPoint -= bulletScript.BulletDamage; break; case BulletScript.BulletType.Normal: HealthPoint -= bulletScript.BulletDamage; break; } Destroy(bulletScript.gameObject); bulletScript.GetComponent <Collider>().enabled = false; if (HealthPoint <= 0) { if (Achievement.minionKills < 10) { Achievement.minionKills++; } Dead(); } } }