Example #1
0
        public override void RemoveItemFromBasket(BasketItemSlotUI item)
        {
            if (!basketItems.Contains(item))
            {
                Debug.LogError("Item was not found on the basket.");
            }

            // If it exists more than once, substract from its quantity
            if (item.currentQuantity > 1)
            {
                item.currentQuantity--;
            }
            else
            {
                basketItems.Remove(item);
                Destroy(item.gameObject);
            }

            Refresh();
        }
Example #2
0
 protected void UpdateItemSlot(BasketItemSlotUI basketItem) => basketItem.SetItem(basketItem.currentItem, basketItem.currentPrice, basketItem.currentQuantity);