using System.Collections.Generic;
|
using UnityEngine;
|
|
public class HeroFatesAttrCell : MonoBehaviour
|
{
|
[SerializeField] HeroFatesAttrItem[] items;
|
|
HeroFatesManager manager { get { return HeroFatesManager.Instance; } }
|
|
public void Display(int rowIndex, List<int> totalAttrIdList, Dictionary<int, long> totalAttrDict)
|
{
|
if (totalAttrIdList.IsNullOrEmpty() || totalAttrDict.IsNullOrEmpty())
|
{
|
return;
|
}
|
|
for (int i = 0; i < items.Length; i++)
|
{
|
int index = rowIndex * manager.attrRowCountMax + i;
|
if (index < totalAttrIdList.Count)
|
{
|
if (index >= totalAttrIdList.Count || index < 0)
|
{
|
continue;
|
}
|
int attrId = totalAttrIdList[index];
|
if (!totalAttrDict.ContainsKey(attrId))
|
{
|
continue;
|
}
|
long attrValue = totalAttrDict[attrId];
|
|
items[i].SetActive(true);
|
items[i].Display(attrId, attrValue);
|
}
|
else
|
{
|
items[i].SetActive(false);
|
}
|
}
|
|
}
|
}
|