少年修仙传客户端代码仓库
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
60
61
62
using UnityEngine;
using UnityEngine.UI;
using Snxxz.UI;
 
 
public class EquipWashCell : MonoBehaviour
{
    [SerializeField] public Button cellToggle;
    [SerializeField] public ItemCell itemCell;
    [SerializeField] public Text nameText;
    [SerializeField] public Text washLevelText;
    [SerializeField] public GameObject noEquipGo;
    [SerializeField] public Text placeText;
    [SerializeField] public Text isPutOnText;
    [SerializeField] GameObject unSelectImg;
    [SerializeField] GameObject selectImg;
 
    [SerializeField] public RedpointBehaviour washRedpoint;
 
    PlayerPackModel playerPack{get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); }}
    EquipWashModel equipWashModel {get{return ModelCenter.Instance.GetModel<EquipWashModel>();}}
 
    public void SetDisplayModel(WashProCount washPro, int repointId, int index, int selectIndex)
    {
        ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Equip, washPro.EquipPlace);
        var washModel = EquipWashConfig.GetEquipWashData(equipWashModel.OnGetWashType(washPro.EquipPlace), washPro.XLAttrLV);
        washRedpoint.redpointId = repointId;
        if (itemModel != null && washModel != null)
        {
            itemCell.gameObject.SetActive(true);
            nameText.gameObject.SetActive(true);
            washLevelText.gameObject.SetActive(true);
            noEquipGo.SetActive(false);
            nameText.text = UIHelper.AppendStringColor(itemModel.config.ItemColor, itemModel.config.ItemName, true);
            //pdr ToDo
            itemCell.Init(itemModel);
            washLevelText.text = equipWashModel.GetCurWashLvStr(washPro, washModel.washConfig);
        }
        else
        {
           itemCell.gameObject.SetActive(false);
           nameText.gameObject.SetActive(false);
           washLevelText.gameObject.SetActive(false);
           noEquipGo.SetActive(true);
           placeText.text = StringUtility.Contact(Language.Get("EquipWin_PartTitleText_1"), UIHelper.GetEquipPlaceName(washPro.EquipPlace));
           isPutOnText.text = Language.Get("StrengtheningPanel_DownText_1");
        }
 
        if(index == selectIndex)
        {
            selectImg.SetActive(true);
            unSelectImg.SetActive(false);
        }
        else
        {
            selectImg.SetActive(false);
            unSelectImg.SetActive(true);
        }
 
    }
 
}