void Update() { //used for highlighting the turbine when is damaged. if (turbine.IsDamaged()) { HighlightTurbine(turbine.IsDamaged()); } }
public void turbineRepair() { if (turbine.IsDamaged()) { turbine.SetDamage(false); turbine.EnableTurbine(); isRepaired = true; } }
void Update() { if (turbine.IsDamaged() == true && isEmiting == false) { EmitParticle(); } else if (turbine.isRepaired() == true && isEmiting == true) { StopParticle(); } }
/* * ===================================== * Calculate the propability that a * turbine can get damaged * ===================================== */ void CalculateDamagePropability() { if (simulator.minutesCount >= damageStartTime && turbine.IsRotating() == true && turbine.IsDamaged() == false && TurbineController.damagedTurbines <= 4) { propabilityMultiplier = Random.Range(0.0f, 1.0f); turbineUsage = 0.0f; if (string.Compare(simulator.powerUsage, "-Over power") == 0) { turbineUsage = 1.3f; } else if (string.Compare(simulator.powerUsage, "-Correct power") == 0) { turbineUsage = 1.0f; } else { turbineUsage = 0.0f; } float damagePropability = turbineUsage * propabilityMultiplier; if (damagePropability > 0.85) { damageTurbine(); } } }