/// <summary>Called by Unity when plugin is unloaded</summary> public void OnDestroy() { Debug.Log("[Kerbulator] Destroy"); if (gui != null) { gui.OnDestroy(); } gui = null; RemoveToolbarButton(); }
/// <summary>Called by Unity when the Plugin is loaded</summary> void Awake() { Debug.Log("[Kerbulator] Start"); options = LoadConfig(); gui = new KerbulatorGUI(this, false, false, options); if (!ToolbarManager.ToolbarAvailable) { GameEvents.onGUIApplicationLauncherReady.Add(InitToolbarButton); GameEvents.onGUIApplicationLauncherUnreadifying.Add(OnGuiApplicationLauncherUnreadifying); } Debug.Log("[Kerbulator] Start done"); }
/// <summary>Called by Unity when the Plugin is started</summary> void Start() { if (ToolbarManager.ToolbarAvailable) { mainWindowEnabled = false; mainButton = ToolbarManager.Instance.add("Kerbulator", "Kerbulator"); mainButton.TexturePath = "Kerbulator/Textures/kerbulator"; mainButton.ToolTip = "Open a powerful calculator"; mainButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); mainButton.OnClick += (e) => { gui.ChangeState(!mainWindowEnabled); }; } gui = new KerbulatorGUI(this, false, !ToolbarManager.ToolbarAvailable); }
/// <summary>Called by Unity when the Plugin is started</summary> void Awake() { options = new KerbulatorOptions(); gui = new KerbulatorGUI(this, true, true, options); }
/// <summary>Called by Unity when the Plugin is started</summary> void Start() { gui = new KerbulatorGUI(this, true, true); }
/// <summary>Called by Unity when the Plugin is started</summary> void Start() { if(ToolbarManager.ToolbarAvailable) { mainWindowEnabled = false; mainButton = ToolbarManager.Instance.add("Kerbulator", "Kerbulator"); mainButton.TexturePath = "Kerbulator/Textures/kerbulator"; mainButton.ToolTip = "Open a powerful calculator"; mainButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); mainButton.OnClick += (e) => { gui.ChangeState(!mainWindowEnabled); }; } gui = new KerbulatorGUI(this, false, !ToolbarManager.ToolbarAvailable); }