using System.Collections.Generic; using UnityEngine; public class PhantasmPavilionModelCell : MonoBehaviour { readonly PhantasmPavilionType type = PhantasmPavilionType.Model; [SerializeField] List items = new List(); PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } public void Display(int rowIndex, CellView cellView) { int tabType = cellView.info.Value.infoInt1; List 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); } } } } }