Пример #1
0
 public void HandleClick()
 {
     craftingWindow.SetItemIcon(Sprite.Create(craftableItem.itemIcon, new Rect(0, 0, craftableItem.itemIcon.width, craftableItem.itemIcon.height),
                                              new Vector2(0.5f, 0.5f)));
     craftingWindow.SetItemName(craftableItem.itemName);
     craftingWindow.craftBtn.interactable = true;
     reqScrollList.UpdateRequirements(craftableItem);
 }
Пример #2
0
    /// <summary>
    /// Refreshes the craftables scroll list.
    /// </summary>
    public void RefreshDisplay()
    {
        RemoveButtons();
        AddButtons();

        if (contentPanel.childCount <= 0 || !inventory.CraftableContains(craftingWindow.GetItemName()))
        {
            craftingWindow.craftBtn.interactable = false;
            craftingWindow.SetItemIcon(null);
            craftingWindow.SetItemName("Select an item");
            requirementScrollList.UpdateRequirements();
        }
    }