Exemplo n.º 1
0
 public void updateGUI()
 {
     m_FlyByWireToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
     m_MouseDirectorToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
     m_CruiseControlToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
     m_FlyByWireToggle.isOn     = controller.currentAutopilot == Autopilots.FLYBYWIRE;
     m_MouseDirectorToggle.isOn = controller.currentAutopilot == Autopilots.MOUSEDIR;
     m_CruiseControlToggle.isOn = controller.currentAutopilot == Autopilots.CRUISECTRL;
     m_FlyByWireToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.RuntimeOnly);
     m_MouseDirectorToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.RuntimeOnly);
     m_CruiseControlToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.RuntimeOnly);
     if (controller.currentAutopilot == Autopilots.DISABLED)
     {
         m_SpeedControlPanel.fadeOut();
         m_CruiseControl.fadeOut();
         m_FBWControl.fadeOut();
     }
     else
     {
         m_SpeedControlPanel.fadeIn();
         m_SpeedControlToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
         m_SpeedControlSlider.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
         m_SpeedControlToggle.isOn  = controller.speedControl;
         m_SpeedControlSlider.value = controller.speed;
         m_SpeedControlToggle.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.RuntimeOnly);
         m_SpeedControlSlider.onValueChanged.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.RuntimeOnly);
         if (controller.speedControl)
         {
             m_SpeedControlValue.text      = controller.speed.ToString("0.#") + " m/s";
             m_SpeedControlValue.alignment = TextAnchor.MiddleRight;
         }
         else
         {
             m_SpeedControlValue.text      = "OFF";
             m_SpeedControlValue.alignment = TextAnchor.MiddleCenter;
         }
         if (controller.currentAutopilot == Autopilots.FLYBYWIRE)
         {
             m_CruiseControl.fadeOut();
             m_FBWControl.fadeIn();
             m_FBWControl.updateGUI();
         }
         else if (controller.currentAutopilot == Autopilots.MOUSEDIR)
         {
             m_CruiseControl.fadeOut();
             m_FBWControl.fadeOut();
         }
         else if (controller.currentAutopilot == Autopilots.CRUISECTRL)
         {
             m_FBWControl.fadeOut();
             m_CruiseControl.fadeIn();
             m_CruiseControl.updateGUI();
         }
     }
 }
Exemplo n.º 2
0
 internal void fadeOut()
 {
     fader.fadeOut();
 }