Exemplo n.º 1
0
 void onAppBtnToggle()
 {
     Debug.Log("onAppBtnToggleOn");
     if (gui != null)
     {
         Debug.Log("visible: " + gui.visible.ToString());
         if (!gui.visible)
         {
             gui.visible    = true;
             gui.multiplier = "";
             gui.decay      = FailureModule.decayPerMinute.ToString();
         }
         else
         {
             UnityEngine.Object.Destroy(gui);
             gui = null;
         }
     }
     else
     {
         Debug.Log("Adding new object");
         // Use MapView.MapCamera to get a gameObject
         gui = MapView.MapCamera.gameObject.GetComponent <ippo.Runtime.GUI.StreamMultiplier>();
         if (gui == null)
         {
             gui = MapView.MapCamera.gameObject.AddComponent <ippo.Runtime.GUI.StreamMultiplier>();
         }
         gui.visible    = true;
         gui.multiplier = "";
         gui.decay      = FailureModule.decayPerMinute.ToString();
     }
 }
Exemplo n.º 2
0
 void onAppBtnToggle()
 {
     Log.Info("onAppBtnToggleOn");
     if (HighLogic.LoadedSceneIsFlight)
     {
         ippo.Runtime.GUI.FailureStatusWindow.instance.isVisible = !ippo.Runtime.GUI.FailureStatusWindow.instance.isVisible;
     }
     else
     {
         if (gui != null)
         {
             Log.Info("visible: " + gui.visible.ToString());
             if (!gui.visible)
             {
                 gui.visible    = true;
                 gui.multiplier = "";
                 gui.decay      = FailureModule.decayPerMinute.ToString();
             }
             else
             {
                 UnityEngine.Object.Destroy(gui);
                 gui = null;
             }
         }
         else
         {
             Log.Info("Adding new object");
             // Use MapView.MapCamera to get a gameObject
             gui = MapView.MapCamera.gameObject.GetComponent <ippo.Runtime.GUI.StreamMultiplier>();
             if (gui == null)
             {
                 gui = MapView.MapCamera.gameObject.AddComponent <ippo.Runtime.GUI.StreamMultiplier>();
             }
             gui.visible    = true;
             gui.multiplier = "";
             gui.decay      = FailureModule.decayPerMinute.ToString();
         }
     }
 }