少年修仙传客户端代码仓库
client_Wu Xijin
2019-04-28 8d06932ebf186837e048da4822bd837dbf90e212
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, April 01, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
 
    public class TipOperateButton : MonoBehaviour
    {
        [SerializeField] Button m_Button;
        [SerializeField] Text m_Title;
 
        string windowName;
        ItemOperateType operateType;
        string guid;
 
        public void SetActive(bool active)
        {
            this.gameObject.SetActive(active);
        }
 
        public void Bind(string windowName, ItemOperateType type, string guid)
        {
            this.windowName = windowName;
            this.operateType = type;
            this.guid = guid;
            switch (type)
            {
                case ItemOperateType.putAway:
                    this.m_Title.text = "上架";
                    break;
                case ItemOperateType.sell:
                    this.m_Title.text = "出售";
                    break;
                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;
                case ItemOperateType.exchange:
                    this.m_Title.text = "兑换";
                    break;
                default:
                    this.m_Title.text = "";
                    break;
            }
 
            m_Button.SetListener(() =>
            {
                WindowCenter.Instance.Close(windowName);
                if (this.operateType==ItemOperateType.buy)
                {
                    ItemTipUtility.GoodOperate(operateType, BuyItemController.Instance.goodId, BuyItemController.Instance.wannaBuyCount.value);
                }
                else
                {
                    ItemTipUtility.Operate(operateType, this.guid);
                }
            });
        }
 
    }
}