You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

42 lines
867 B

using System;
using UnityEngine;
public class ListRowDelegate
{
public Action<EscrListRowSlot> 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;
}
}