Пример #1
0
    public bool BuyIfPossible(InventoryItem item)
    {
        List <InventoryItem> items = manager.items;
        int index = items.IndexOf(item);
        int price = prices[index];

        if (CharacterController.instance.numSpiritOrbs >= price)
        {
            CharacterController.instance.useSpiritOrbs(price);
            manager.Remove(item);
            prices.RemoveAt(index);
            MarkedInventoryItem marked = item as MarkedInventoryItem;
            InventoryManager.playerInventory.Add(marked.innerItem);
            menu.SetMerchantInfo(this, manager.items, prices);
            return(true);
        }
        return(false);
    }