public override void Show()
    {
        for (int i = 0; i < Capacity; i++)
        {
            if (DisplayerCount == i)
            {
                displayers.Add(CreateDisplayer());
            }

            BillRowViewDisplayer displayer = GetDisplayer(i);
            if (displayer)
            {
                displayer.gameObject.SetActive(true);
                displayer.SetNumber(i + 1);
                SetupDisplayer(displayer, GetItem(i));
            }
        }

        for (int i = Capacity; i < DisplayerCount; i++)
        {
            BillRowViewDisplayer displayer = GetDisplayer(i);
            if (displayer)
            {
                displayer.gameObject.SetActive(false);
            }
        }
    }
 public void SetupDisplayer(BillRowViewDisplayer displayer, Bill item)
 {
     if (displayer == null)
     {
         return;
     }
     displayer.AddOnSelect(onSelect).SetModel(item).Show();
 }
Exemple #3
0
 private void OnSelectBillRow(BillRowViewDisplayer displayer)
 {
     OpenEditBillPanel(displayer.Model);
 }
    protected BillRowViewDisplayer CreateDisplayer()
    {
        BillRowViewDisplayer viewItem = Instantiate(prefab, layout);

        return(viewItem);
    }