/// <summary> /// Awake this instance. /// </summary> public void Awake() { if (_instance) { Destroy(_instance); } _instance = this; }
/// <summary> /// Called when destroying this instance. /// </summary> public void OnDestroy() { RenderingManager.RemoveFromPostDrawQueue (0, OnDraw); if (_instance == this) _instance = null; PluginConfiguration config = PluginConfiguration.CreateForType<KartographSettings> (); config.load (); config.SetValue ("AutoHide", _autoHide); config.SetValue ("KrakenDisable", _disableKraken); config.save (); }
/// <summary> /// Start this instance. /// </summary> public void Start() { if (_instance) { Destroy(_instance); } _instance = this; _winID = GUIUtility.GetControlID(FocusType.Passive); PluginConfiguration config = PluginConfiguration.CreateForType <KartographSettings> (); config.load(); _autoHide = config.GetValue <bool> ("AutoHide", true); _disableKraken = config.GetValue <bool> ("KrakenDisable", false); }
/// <summary> /// Called when destroying this instance. /// </summary> public void OnDestroy() { RenderingManager.RemoveFromPostDrawQueue(0, OnDraw); if (_instance == this) { _instance = null; } PluginConfiguration config = PluginConfiguration.CreateForType <KartographSettings> (); config.load(); config.SetValue("AutoHide", _autoHide); config.SetValue("KrakenDisable", _disableKraken); config.save(); }
/// <summary> /// Called when destroying this instance. /// </summary> public void OnDestroy() { ControlUnlock(); PluginConfiguration config = PluginConfiguration.CreateForType <KartographSettings> (); config.load(); config.SetValue("AutoHide", _autoHide); config.SetValue("KrakenDisable", _disableKraken); config.SetValue("UseKspSkin", _useKspSkin); config.SetValue("UseToolbar", _useToolbar); config.SetValue("SettingsWindowPos", _windowPos); config.save(); GameEvents.onHideUI.Remove(Hide); GameEvents.onShowUI.Remove(UnHide); GameEvents.onGamePause.Remove(Hide); GameEvents.onGameUnpause.Remove(UnHide); if (_instance == this) { _instance = null; } }
/// <summary> /// Start this instance. /// </summary> public void Start() { if (_instance) Destroy (_instance); _instance = this; _winID = GUIUtility.GetControlID (FocusType.Passive); PluginConfiguration config = PluginConfiguration.CreateForType<KartographSettings> (); config.load (); _autoHide = config.GetValue<bool> ("AutoHide", true); _disableKraken = config.GetValue<bool> ("KrakenDisable", false); }