/// <summary> /// Kinda constructor /// </summary> public void Awake() { if (Instance != null) { Destroy(this); return; } Instance = this; }
/// <summary> /// Hail to The King, baby /// </summary> public void OnDestroy() { GameEvents.onGUIApplicationLauncherReady.Remove(onGUIApplicationLauncherReady); GameEvents.onLevelWasLoaded.Remove(onLevelWasLoaded); GameEvents.onVesselChange.Remove(onVesselChange); GameEvents.onHideUI.Remove(onHideUI); GameEvents.onShowUI.Remove(onShowUI); GameEvents.onGamePause.Remove(onGamePause); GameEvents.onGameUnpause.Remove(onGameUnpause); UnlockControls(); DestroyLauncher(); config.SetValue("windowRect", windowRect); config.SetValue("useToolbar", useToolbar); config.SetValue("maximized", maximized); config.save(); if (Instance == this) { Instance = null; } }