public static void ShowInterface(bool state) { Initialize(); if (IsInterfaceVisible == state) { return; } _customizeButton.Caption = state ? "Save & Close" : "Customize UI"; //destroying a Component and then adding the same Component can crash the game. var collider = _customizeButton.Child("Collider"); if (state) { if (_customizeButton.HasComponent <UIDragObject>()) { collider.SetBehaviors <UIDragObject>(true); } else { collider.AddComponent <UIDragObject>().target = _customizeButton.GameObject.transform; } } else { collider.SetBehaviors <UIDragObject>(false); } if (state && !IsInterfaceCreated) { CreateInterface(); return; } TooltipOffsetCheckbox.SetActive(state); DragPartyBar.SetActive(state); DragHugBgr.SetActive(state); DragLog.SetActive(state); DragAbilitiesBar.SetActive(state); ToggleLogButtons.SetActive(state); ToggleHudOrientation.SetActive(state); DragHudPanelLeft.SetActive(state); DragHudPanelRight.SetActive(state); DragClock.SetActive(state); ToggleHudBgr.SetActive(state); TogglePartyOrientation.SetActive(state); ToggleBuffsSide.SetActive(state); DragFormationBar.SetActive(state); FrameDropdown.SetActive(state); ToggleButtonsBgr.SetActive(state); TogglePortraitHighlights.SetActive(state); ToggleCustomTextures.SetActive(state); SaveBtn.SetActive(state); CancelBtn.SetActive(state); UseDefaultUIBtn.SetActive(state); }