public void DropAllOfType(CollectibleItem.ItemType itemType, DropHandler handler = null) { if (handler != null) { foreach (CollectibleItem item in items.FindAll(i => i.itemType == itemType)) { Drop(item, handler); } } }
void UpdateInventoryLabel(CollectibleItem.ItemType itemType, int change) { if (itemType == CollectibleItem.ItemType.ShroomItem) { magicItemCount += change; magicItemLabel.text = "x" + magicItemCount; } else if (itemType == CollectibleItem.ItemType.Firewood) { fireWoodCount += change; fireWoodLabel.text = "x" + fireWoodCount; } }
public bool DropOneOfType(CollectibleItem.ItemType itemType, DropHandler handler = null) { CollectibleItem item = items.Find(i => i.itemType == itemType); return(Drop(item, handler)); }