Ejemplo n.º 1
0
    public void UpdateCraftable()
    {
        craftsHandler.UpdateRecipe();
        CraftingSlot selectedSlot = craftsHandler.GetSlotSelected();

        if (selectedSlot == null)
        {
            return;
        }
        numbersHandler.UpdateNumbers();
        if (selectedSlot.GetIsCraftable())
        {
            StartCoroutine(ExecuteAfterTime(1f));
        }
        else
        {
            craftButton.interactable = false;
        }
    }
Ejemplo n.º 2
0
    public void SlotSelected()
    {
        CraftingSlot selectedSlot = craftsHandler.GetSlotSelected();
        Item         selectedItem = selectedSlot.GetItem();

        descBackground.SetActive(true);
        nameText.SetText(selectedItem.name);
        descriptionText.SetText(selectedItem.GetDescription());
        itemPreview.sprite = selectedItem.GetSprite();
        if (selectedSlot.GetIsCraftable())
        {
            craftButton.interactable = true;
        }
        else
        {
            craftButton.interactable = false;
        }
        numbersHandler.Show(selectedSlot);
    }