using System.Collections.Generic;
|
using UnityEngine;
|
|
public class PhantasmPavilionModelCell : MonoBehaviour
|
{
|
readonly PhantasmPavilionType type = PhantasmPavilionType.Model;
|
[SerializeField] List<PhantasmPavilionModelItem> items = new List<PhantasmPavilionModelItem>();
|
PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
|
public void Display(int rowIndex, CellView cellView)
|
{
|
int tabType = cellView.info.Value.infoInt1;
|
List<int> showItemList = manager.ShowItemList(type, tabType);
|
if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax))
|
return;
|
for (int i = 0; i < items.Count; i++)
|
{
|
int index = rowIndex * rowCountMax + i;
|
if (!showItemList.IsNullOrEmpty())
|
{
|
if (index < showItemList.Count)
|
{
|
items[i].SetActive(true);
|
items[i].Display(showItemList[index]);
|
}
|
else
|
{
|
items[i].SetActive(false);
|
}
|
}
|
}
|
}
|
|
}
|