void OnDestroy() { Instance = null; if (ELSettingsButton != null) { ELSettingsButton.Destroy(); } ELAppButton.Toggle -= ELSettings.ToggleGUI; }
public void Awake() { Instance = this; ELAppButton.Toggle += ELSettings.ToggleGUI; if (ToolbarManager.Instance == null) { return; } ELSettingsButton = ToolbarManager.Instance.add("ExtraplanetaryLaunchpads", "ELSettingsButton"); ELSettingsButton.Visible = ELSettings.PreferBlizzy; ELSettingsButton.TexturePath = "ExtraplanetaryLaunchpads/Textures/icon_button"; ELSettingsButton.ToolTip = "EL Settings Window"; ELSettingsButton.OnClick += (e) => ELSettings.ToggleGUI(); }