示例#1
0
    void OnClickOnItem(CraftSO craft)
    {
        selectedCraft = craft;

        inventoryToAddItem.InitInvetory(selectedCraft.results.Length);
        inventoryToRemoveItem.InitInvetory(selectedCraft.ingradients.Length);

        for (int i = 0; i < selectedCraft.results.Length; ++i)
        {
            inventoryToAddItem.SetFilter(i, selectedCraft.results[i].itemSO);
        }

        for (int i = 0; i < selectedCraft.ingradients.Length; ++i)
        {
            inventoryToRemoveItem.SetFilter(i, selectedCraft.ingradients[i].itemSO);
        }

        cgSelectCraft.interactable = cgSelectCraft.blocksRaycasts = false;
        LeanTween.cancel(cgSelectCraft.gameObject, false);
        LeanTweenEx.ChangeAlpha(cgSelectCraft, 0.0f, 0.2f).setEase(LeanTweenType.easeInOutQuad);

        cgCraftingPlace.interactable = cgCraftingPlace.blocksRaycasts = true;
        LeanTween.cancel(cgCraftingPlace.gameObject, false);
        LeanTweenEx.ChangeAlpha(cgCraftingPlace, 1.0f, 0.2f).setEase(LeanTweenType.easeInOutQuad);

        craftingPlace.ResetCraftTime();
        TryCraft();

        previousCraft = null;
    }
示例#2
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();
        }
    }