public void ManageDamage(DamageController damagecontroller) { // Applies damage to the health of this object health -= damagecontroller.GetDamage(); //Destroys the laser on collision damagecontroller.Hit(); //Destroys the object when the health is <= 0 if (health <= 0) { //Triggers death function TriggerDeath(); } }
private void ManageDamage(DamageController damagecontroller) { // Applies damage to the health of this object shield -= damagecontroller.GetDamage(); // Updates the health bar UpdateHealthBar(); // Destroys the laser on collision damagecontroller.Hit(); //Destroys the object when the health is <= 0 if (shield <= 0) { PlayerDie(); } }