Beispiel #1
0
 private void UpdateList()
 {
     itemList.Clear();
     itemList.AddItems(vendorContent.Count);
     for (int i = 0; i < vendorContent.Count; i++)
     {
         VendorItemEntry item = itemList.Entries[i] as VendorItemEntry;
         item.SetItem(vendorContent[i], this);
     }
 }
Beispiel #2
0
    /// <summary>
    /// Clear all items and send new vendor state to clients UI
    /// </summary>
    private void UpdateAllItemsView()
    {
        if (!vendor)
        {
            return;
        }

        // remove all items UI
        itemList.Clear();

        var vendorContent = vendor.VendorContent;

        itemList.AddItems(vendorContent.Count);

        // update UI for clients
        for (int i = 0; i < vendorContent.Count; i++)
        {
            VendorItemEntry item = itemList.Entries[i] as VendorItemEntry;
            item.SetItem(vendorContent[i], this);
        }
    }