少年修仙传客户端代码仓库
client_Hale
2019-04-13 d4b5806a57e4e88a1fc57dd95f17e185f33e4e43
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
//--------------------------------------------------------
//    [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;
 
        ItemOperateType operateType;
        string guid;
 
        public void SetActive(bool active)
        {
            this.gameObject.SetActive(active);
        }
 
        public void Bind(ItemOperateType type, string guid)
        {
            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;
                default:
                    this.m_Title.text = "";
                    break;
            }
 
            m_Button.SetListener(() =>
            {
                WindowCenter.Instance.Close<EquipTipWin>();
                EquipTipUtility.Operate(operateType, this.guid);
            });
        }
 
    }
}