using System; using UnityEngine; public class ListRowDelegate { public Action OnSetData; } public partial class EscrListRow : EScrCell, IOnRecieveIntent { [SerializeField] EscrListRowSlot[] slotUIs; ListRowDelegate listRowDelegate; int rowIndex; public int SlotCount => slotUIs.Length; public override void RefreshCellView() { SetData(rowIndex); } public override void SetData(int itemid) { if(listRowDelegate is null) return; rowIndex = itemid; for (int i = 0; i < slotUIs.Length; ++i) { slotUIs[i].RowIndex = itemid; slotUIs[i].ColumnIndex = i; listRowDelegate.OnSetData?.Invoke(slotUIs[i]); } } public void OnRecieveIntent(object intent) { listRowDelegate = intent as ListRowDelegate; } }