public void TakeDamage(float dmgValue) { if (health > 0.0f) { health -= dmgValue; // Change State if (health <= 0.0f) { buildingDamage = BuildingDamage.destroyed; } else if (health <= 0.25f) { buildingDamage = BuildingDamage.stage3; } else if (health <= 0.50f) { buildingDamage = BuildingDamage.stage2; } else if (health <= 0.75f) { buildingDamage = BuildingDamage.stage1; } } }
public void TakeDamage( float dmgValue ) { if( health > 0.0f) { health -= dmgValue; // Change State if( health <= 0.0f) { buildingDamage = BuildingDamage.destroyed; } else if (health <= 0.25f) { buildingDamage = BuildingDamage.stage3; } else if (health <= 0.50f) { buildingDamage = BuildingDamage.stage2; } else if (health <= 0.75f) { buildingDamage = BuildingDamage.stage1; } } }