Exemple #1
0
 /*
  * damages the turbine and stops it's operation
  */
 void damageTurbine()
 {
     turbine.DisableTurbine();
     isDamaged = true;
     turbine.setRepair(false);
     TurbineController.damagedTurbines++;
 }
 //when user clicks the turbine.
 void OnMouseDown()
 {
     //clicks while turbine is rotating.
     if (turbine.IsRotating() == true && turbine.IsDamaged() == false)
     {
         turbine.DisableTurbine();
         GoedleAnalytics.track("disable.turbine");
     }
     //clicks while is not rotating.
     else if (turbine.IsRotating() == false && turbine.IsDamaged() == false)
     {
         turbine.EnableTurbine();
         GoedleAnalytics.track("enable.turbine");
     }
     //clicks while turbine is damaged.
     else if (turbine.IsDamaged() == true)
     {
         turbine.repairTurbine();
         GoedleAnalytics.track("repair.turbine");
     }
 }
 //when user clicks the turbine.
 void OnMouseDown()
 {
     //clicks while turbine is rotating.
     if (turbine.IsRotating() == true && turbine.IsDamaged() == false)
     {
         turbine.DisableTurbine();
         GoedleAnalytics.instance.track("disable.turbine");
         SoundManager.instance.PlaySound(turnOff);
     }
     //clicks while is not rotating.
     else if (turbine.IsRotating() == false && turbine.IsDamaged() == false)
     {
         turbine.EnableTurbine();
         GoedleAnalytics.instance.track("enable.turbine");
         SoundManager.instance.PlaySound(turnOn);
     }
     //clicks while turbine is damaged.
     else if (turbine.IsDamaged() == true)
     {
         turbine.RepairTurbine();
         GoedleAnalytics.instance.track("repair.turbine");
         SoundManager.instance.PlaySound(repair);
     }
 }
Exemple #4
0
 public void DamageTurbine()
 {
     turbine.DisableTurbine();
     isDamaged = true;
     turbine.SetRepair(false); // In case the turbine is repaired previously we set the repair boolean to false, so to be availiable for repairing.
 }