void Update() { if (controller.EngineOn) { fanAudio.Set(controller.GetFan() ? 1f : 0.0f); } else { fanAudio.Set(0.0f); } }
void Update() { if (!controller) { return; } if (controller.GetEngineRunning()) { fanAudio.Set(controller.GetFan() ? 1f : 0.0f); } else { fanAudio.Set(0.0f); } }
public bool UpdateFan() { var temperature = controller.sim.engineTemp.value; if (controller.GetFan()) { fanRunning = true; } else if (temperature > FanOnThreshold) { fanRunning = true; } else if (temperature < FanOffThreshold) { fanRunning = false; } return(fanRunning); }