示例#1
0
 public void onUIDestroy()
 {
     UI = null;
     foreach (KSP.UI.Screens.CraftBrowserDialog dialog in GameObject.FindObjectsOfType(typeof(KSP.UI.Screens.CraftBrowserDialog)))
     {
         dialog.OnBrowseCancelled();
     }
     foreach (GameObject go in GameObject.FindObjectsOfType <GameObject>())
     {
         if (go.name == "CraftBrowser(Clone)")
         {
             Destroy(go);
         }
     }
 }
示例#2
0
 public IEnumerator waitOriginalDialog()
 {
     while (GameObject.Find("CraftBrowser(Clone)") == null)
     {
         if (waitCount < 30)
         {
             waitCount++;
         }
         else
         {
             needsFileReload = true; // Case when 'unsaved craft dialog' appears
         }
         yield return(null);
     }
     if (needsFileReload)
     {
         FetchShipFiles();
     }
     needsFileReload = false;
     if (UI == null)
     {
         UI = gameObject.AddComponent <SMUI>();
     }
 }