Пример #1
0
        void OnGameSceneLoadRequested(GameScenes scene)
        {
            if (scene == GameScenes.SPACECENTER)
            {
                if (Planetarium.GetUniversalTime() > 300)
                {
                    DefaultSystem();
                    showGUI = false;
                }
                else if (File.Exists(KSPUtil.ApplicationRootPath + "/saves/" + HighLogic.SaveFolder + "/PlanetRandomizer.cfg"))
                {
                    print("Loading System");
                    PlanetSettings.Load(KSPUtil.ApplicationRootPath + "/saves/" + HighLogic.SaveFolder + "/PlanetRandomizer.cfg");
                    RebuildSystem();
                }
                else if (!File.Exists(KSPUtil.ApplicationRootPath + "/saves/" + HighLogic.SaveFolder + "/PlanetRandomizer.cfg"))
                {
                    DefaultSystem();
                    print("Showing GUI");
                    showGUI = true;
                }
            }

            /*if (scene == GameScenes.MAINMENU)
             * {
             *  PlanetSettings.Load(KSPUtil.ApplicationRootPath + "/GameData/PlanetRandomizer/Resources/PlanetRandomizer.cfg");
             *  DefaultSystem();
             * }*/
        }
Пример #2
0
 public void Start()
 {
     if (Instance)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
         GameEvents.onGameSceneLoadRequested.Add(new EventData <GameScenes> .OnEvent(OnGameSceneLoadRequested));
         PlanetSettings.Load(KSPUtil.ApplicationRootPath + "/GameData/PlanetRandomizer/Resources/PlanetRandomizer.cfg");
         PlanetDefault.Load(KSPUtil.ApplicationRootPath + "/GameData/PlanetRandomizer/Resources/PlanetRandomizer.cfg");
     }
 }