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);
            }
        }
Beispiel #3
0
            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);
            }