少年修仙传客户端代码仓库
hch
2025-07-02 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
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 vnxbqy.UI;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
public class EquipEvolveCell : ILBehaviour
{
    ItemCell itemCell;
    Text equipName;
    Text equipState;
    Button selectEquip;
    Image selectImage;
 
    EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
    PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
 
    protected override void Awake() 
    {
        selectEquip = proxy.GetWidgtEx<Button>("EquipSelect");
        equipName = proxy.GetWidgtEx<Text>("Txt_Name");
        equipState = proxy.GetWidgtEx<Text>("Txt_Rate");
        itemCell = proxy.GetWidgtEx<ItemCell>("ItemCell");
        selectImage = proxy.GetWidgtEx<Image>("selectImage");
    }
 
    public void Display(int place)
    {
        var level = EquipEvolveModel.Instance.selectLevelType;
        var position = new Int2(level, place);
        var equipGuid = equipModel.GetEquip(position);
        selectImage.SetActiveIL(EquipEvolveModel.Instance.selectPlaceType == place);
        selectEquip.SetListener(() => {
            EquipEvolveModel.Instance.selectPlaceType = place;
        });
 
        if (string.IsNullOrEmpty(equipGuid))
        {
            itemCell.SetActiveIL(false);
            equipName.text = Language.Get("L1076", UIHelper.GetEquipPlaceName(place));
            equipName.color = UIHelper.GetUIColor(TextColType.NavyBrown, true);
            equipState.text = Language.Get("EquipSuitPanel_IsPutOnText_1");
            equipState.color = UIHelper.GetUIColor(TextColType.Red, true);
            return;
        }
        var item = packModel.GetItemByGuid(equipGuid);
        if (item == null)
            return;
        itemCell.SetActiveIL(true);
        equipName.text = item.config.ItemName;
        equipName.color = UIHelper.GetUIColor(item.config.ItemColor, true);
        equipState.text = string.Empty;
 
 
        var model = new ItemCellModel(item.itemId, false, (ulong)item.count);
        itemCell.Init(model);
        
    }
 
}