protected override void Awake() { if (HighLogic.LoadedScene != GameScenes.SPACECENTER) { Warning("The RnD search function works only on the SpaceCenter. Destroy.", "QRnD"); Destroy(this); return; } QStockToolbar.ResetScenes(); if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER && HighLogic.CurrentGame.Mode != Game.Modes.SCIENCE_SANDBOX) { Warning("The RnD search function works only on a Career or on a Science gamemode. Destroy.", "QRnD"); Destroy(this); return; } if (Instance != null) { Warning("There's already an Instance of " + MOD + ". Destroy.", "QRnD"); Destroy(this); return; } Instance = this; if (!QSettings.Instance.RnDSearch) { Warning("The RnD search function is disabled. Destroy.", "QRnD"); Destroy(this); return; } base.Awake(); Log("Awake", "QRnD"); }
protected override void Awake() { if (Instance != null) { Destroy(this); return; } Instance = this; DontDestroyOnLoad(Instance); GameEvents.onGUIApplicationLauncherReady.Add(AppLauncherReady); GameEvents.onGUIApplicationLauncherDestroyed.Add(AppLauncherDestroyed); GameEvents.onLevelWasLoadedGUIReady.Add(AppLauncherDestroyed); Log("Awake", "QStockToolbar"); }