public void turbineRepair() { if (turbine.IsDamaged()) { turbine.SetDamage(false); turbine.EnableTurbine(); isRepaired = true; } }
//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); } }