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);
|
}
|
}
|
}
|
}
|