using System.Collections.Generic;
|
using UnityEngine;
|
|
public class PhantasmPavilionChatBoxCell : MonoBehaviour
|
{
|
readonly PhantasmPavilionType type = PhantasmPavilionType.ChatBox;
|
[SerializeField] List<PhantasmPavilionChatBoxItem> items = new List<PhantasmPavilionChatBoxItem>();
|
PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
|
public void Display(int rowIndex)
|
{
|
|
List<int> showItemList = manager.ShowItemList(type);
|
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);
|
}
|
}
|
}
|
}
|
|
}
|