少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-20 a87120c155c48fa45b20a97c1a58bdbeb77318b7
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
using UnityEngine;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
 
    public class WashMasterCell : MonoBehaviour
    {
        [SerializeField] CommonItemBaisc itemBaisc;
        [SerializeField] RoleEquipType equipPlace = RoleEquipType.retMax;
        [SerializeField] Text washDesText;
 
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        EquipWashModel washModel { get { return ModelCenter.Instance.GetModel<EquipWashModel>(); } }
 
        public void SetModel(int masterLv)
        {
            ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Equip,(int)equipPlace);
            if(itemModel == null)
            {
                itemBaisc.gameObject.SetActive(false);
                washDesText.text = UIHelper.AppendStringColor(TextColType.Red, Language.Get("EquipSuitPanel_IsPutOnText_1"));
            }
            else
            {
                itemBaisc.gameObject.SetActive(true);
                itemBaisc.Init(itemModel);
                itemBaisc.cellBtn.RemoveAllListeners();
                itemBaisc.cellBtn.AddListener(()=>
                {
                    tipsModel.SetItemTipsModel(PackType.Equip,itemModel.guid);
                });
                int curLv = 1;
                WashProCount washPro = washModel.GetWashEquipInfo((int)equipPlace);
                if (washPro != null)
                {
                    curLv = washPro.XLAttrLV;
                }
                if (masterLv != -1)
                {
                    if (curLv >= masterLv)
                    {
                        washDesText.text = Language.Get("EquipWash119", StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green, curLv.ToString()), "/", masterLv));
                    }
                    else
                    {
                        washDesText.text = Language.Get("EquipWash119", StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Red, curLv.ToString()), "/", masterLv));
                    }
                }
                else
                {
                    washDesText.text = Language.Get("EquipWash119", StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green, curLv.ToString())));
                }
            }
          
        }
    }
}