少年修仙传客户端代码仓库
client_linchunjie
2019-04-23 790a4fda5c6e281d681b0c4a0b5c11ebdbaa52aa
System/ItemTip/TipOperateButton.cs
@@ -14,6 +14,7 @@
        [SerializeField] Button m_Button;
        [SerializeField] Text m_Title;
        string windowName;
        ItemOperateType operateType;
        string guid;
@@ -22,9 +23,10 @@
            this.gameObject.SetActive(active);
        }
        public void Bind(ItemOperateType type, string guid)
        public void Bind(string windowName, ItemOperateType type, string guid)
        {
            operateType = type;
            this.windowName = windowName;
            this.operateType = type;
            this.guid = guid;
            switch (type)
            {
@@ -37,6 +39,39 @@
                case ItemOperateType.makeUse:
                    this.m_Title.text = "使用";
                    break;
                case ItemOperateType.split:
                    this.m_Title.text = "拆分";
                    break;
                case ItemOperateType.inlay:
                    this.m_Title.text = "镶嵌";
                    break;
                case ItemOperateType.putOut:
                    this.m_Title.text = "取出";
                    break;
                case ItemOperateType.putIn:
                    this.m_Title.text = "放入";
                    break;
                case ItemOperateType.compose:
                    this.m_Title.text = "合成";
                    break;
                case ItemOperateType.buy:
                    this.m_Title.text = "购买";
                    break;
                case ItemOperateType.putOn:
                    this.m_Title.text = "穿上";
                    break;
                case ItemOperateType.putOff:
                    this.m_Title.text = "脱下";
                    break;
                case ItemOperateType.strength:
                    this.m_Title.text = "强化";
                    break;
                case ItemOperateType.star:
                    this.m_Title.text = "升星";
                    break;
                case ItemOperateType.train:
                    this.m_Title.text = "洗炼";
                    break;
                default:
                    this.m_Title.text = "";
                    break;
@@ -44,8 +79,15 @@
            m_Button.SetListener(() =>
            {
                WindowCenter.Instance.Close<EquipTipWin>();
                EquipTipUtility.Operate(operateType, this.guid);
                WindowCenter.Instance.Close(windowName);
                if (this.operateType==ItemOperateType.buy)
                {
                    EquipTipUtility.GoodOperate(operateType, BuyItemController.Instance.goodId, BuyItemController.Instance.wannaBuyCount.value);
                }
                else
                {
                    EquipTipUtility.Operate(operateType, this.guid);
                }
            });
        }