Esempio n. 1
0
    void OnEndCraft()
    {
        Destroy(currCraft.gameObject);

        currCraft = null;
        while (currCraft == null && itemsQueueUI.Count != 0)
        {
            currCraft = itemsQueueUI.Dequeue();
        }

        if (currCraft != null)
        {
            craftingPlace.Craft(currCraft.craft);
        }
        else
        {
            craftingPlace.ResetCraftTime();
        }
    }
Esempio n. 2
0
    void TryCraft()
    {
        if (!isCrafting && selectedCraft)
        {
            if (inventoryToRemoveItem.CheckIsEnoughIngradients(selectedCraft))
            {
                isCrafting = true;

                foreach (var ingradient in selectedCraft.ingradients)
                {
                    inventoryToRemoveItem.RemoveItem(ingradient.CloneItem());
                }

                craftingPlace.Craft(selectedCraft);
            }
            else
            {
                craftingPlace.ResetCraftTime();
            }
        }
    }