Ejemplo n.º 1
0
    private void PopulateShopSlots()
    {
        Item curItem       = currentStoreInventory.GetItem(0);
        int  curItemNumber = 0;

        if (currentStoreInventory.GetSize() > shopSlots.Count)
        {
            for (int j = 0; j < shopSlots.Count; j++)
            {
                for (int i = 0; i < currentStoreInventory.GetSize(); i++)
                {
                    if (!Item.IsNull(currentStoreInventory.GetItem(i)) && curItem.item_value > currentStoreInventory.GetItem(i).item_value)
                    {
                        curItem       = currentStoreInventory.GetItem(i);
                        curItemNumber = i;
                    }
                }
                currentStoreInventory.RemoveItem(currentStoreInventory.GetItem(curItemNumber), 1);
                shopSlots[j].DisplayItem(curItem.item_prefab);
                curItem = currentStoreInventory.GetItem(0);
            }
        }
    }