Exemplo n.º 1
0
    public void ToggleCraftingMenu(bool isCrafting, Crafter crafter)
    {
        if (isCrafting)
        {
            thisCrafter = crafter;
            switch (thisCrafter.craftingType)
            {
            case interactableType.Nothing:
                processingPanel.SetActive(false);
                break;

            case interactableType.Fire:
                processingPanel.SetActive(true);
                processingImage.sprite = masterCraftList.fireSprite;
                break;

            case interactableType.Anvil:
                processingPanel.SetActive(true);
                processingImage.sprite = masterCraftList.anvilSprite;
                break;
            }
            List <CraftingRecipe> craftingRecipes = thisCrafter.GetCraftingRecipes();
            BuildMenu(craftingRecipes);
            selectedItem = craftingRecipes[0];
            // buttonHighlighter.ActivateButtons(currentSlots[0].gameObject);

            UpdateCraftingMenu(selectedItem);
            UpdateProcessing();
        }
        else
        {
            thisCrafter = null;
        }
        craftingMenu.SetActive(isCrafting);
    }