Пример #1
0
 protected override void Awake()
 {
     if (HighLogic.LoadedScene != GameScenes.SPACECENTER)
     {
         QDebug.Warning("The RnD search function works only on the SpaceCenter. Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     QStock.ResetScenes();
     if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER && HighLogic.CurrentGame.Mode != Game.Modes.SCIENCE_SANDBOX)
     {
         QDebug.Warning("The RnD search function works only on a Career or on a Science gamemode. Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     if (Instance != null)
     {
         QDebug.Warning("There's already an Instance of " + MOD + ". Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     Instance = this;
     if (!QSettings.Instance.RnDSearch)
     {
         QDebug.Warning("The RnD search function is disabled. Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     base.Awake();
     QDebug.Log("Awake", "QRnD");
 }
Пример #2
0
        void Awake()
        {
            if (Instance != null)
            {
                Destroy(this);
                return;
            }
            Instance = this;
            DontDestroyOnLoad(Instance);

            Init();

            QDebug.Log("Awake", "QStockToolbar");
        }