Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
    public void OpenPopup(string title, string message, System.Action okCallback, System.Action cancelCallback = null, string okLbl = "", string cancelLbl = "")
    {
        // 데이터 설정
        TitleLbl.text   = title;
        MessageLbl.text = message;
        if (string.IsNullOrEmpty(okLbl))
        {
            OkLbl.text = okLbl;
        }
        else
        {
            OkLbl.text = DataMgr.Instance.GetLocal(3);
        }

        if (string.IsNullOrEmpty(cancelLbl))
        {
            CancelLbl.text = cancelLbl;
        }
        else
        {
            CancelLbl.text = DataMgr.Instance.GetLocal(4);
        }

        _OkCallBack     = okCallback;
        _CancelCallBack = cancelCallback;

        // 타이틀 숨김 처리
        TitleLbl.gameObject.SetActive(!string.IsNullOrEmpty(title));

        // 버튼 숨긴 체크

        if (_CancelCallBack != null)
        {
            CancelBtn.SetActive(true);
            OkBtn.transform.localPosition = new Vector3(150, -120, 0);
        }
        else
        {
            CancelBtn.SetActive(false);
            OkBtn.transform.localPosition = new Vector3(0, -120, 0);
        }
    }