Beispiel #1
0
 public override void MoveItemToBasket(ShopItemSlotUI item)
 {
     // Max stack of 1 for furniture upgrades.
     if (basketItems.Any(x => x.currentItem == item.currentItem))
     {
         return;
     }
     base.MoveItemToBasket(item);
 }
Beispiel #2
0
        public override void MoveItemToBasket(ShopItemSlotUI item)
        {
            var existingItem = basketItems.Find(x => x.currentItem == item.currentItem);

            // If it exists, add to its quantity
            if (existingItem != null)
            {
                existingItem.currentQuantity++;
            }
            else
            {
                var newItem = CreateBasketItemSlot();
                newItem.SetItem(item.currentItem, item.currentPrice, 1);
                newItem.SetAction(() => RemoveItemFromBasket(newItem));
            }

            Refresh();
        }
Beispiel #3
0
 protected void UpdateItemSlot(ShopItemSlotUI shopItem) => shopItem.SetItem(shopItem.currentItem, shopItem.currentPrice);