少年修仙传客户端代码仓库
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
using System.Collections.Generic;
using UnityEngine;
 
public class TreasurePavilionScrollerCell : CellView
{
    [SerializeField] List<TextEx> txtInfoList = new List<TextEx>();
 
    public void Display(int index, CellView cellView)
    {
        int resonanceID  = cellView.info.Value.infoInt1;
        var starDict = GubaoResonanceAttrConfig.GetResonanceStarDict();
        var allIdDict = GubaoResonanceAttrConfig.GetDict();
        var starList = starDict[resonanceID];
        for (int i = 0; i < txtInfoList.Count; i++)
        {
            int nowIndex = index * 2 + i;
            if (nowIndex < starList.Count)
            {
                txtInfoList[i].SetActive(true);
                int resonanceStar = starList[nowIndex];
                var id = allIdDict[resonanceID][resonanceStar];
                int nowStar = TreasurePavilionModel.Instance.GetNowStar(id);
                txtInfoList[i].text = TreasurePavilionModel.Instance.GetInfo(id);
                txtInfoList[i].colorType = nowStar >= resonanceStar ? TextColType.DarkGreen : TextColType.LightYellow;
            }
            else
            {
                txtInfoList[i].SetActive(false);
            }
        }
    }
}