コード例 #1
0
    public void CraftItem()
    {
        ItemData craftedItem = null;

        if (RecipeManager.CheckRecipe(new int[] { GetInventoryItemID(40), GetInventoryItemID(41), GetInventoryItemID(42), GetInventoryItemID(43) }, out craftedItem))
        {
            if (AddItem(craftedItem.itemID, craftedItem.amount))
            {
                inventory.RemoveItemAt(40, 1);
                inventory.RemoveItemAt(41, 1);
                inventory.RemoveItemAt(42, 1);
                inventory.RemoveItemAt(43, 1);
            }
            else
            {
                Debug.LogError("Can't add to inventory");
            }
        }
    }