private void UpdateCraftingDisplay() { if (craftingButtons == null) { return; } foreach (ItemType itemType in craftingButtons.Keys) { GameObject btn = craftingButtons[itemType]; CraftingRecipe itemRecipe = ItemRegistry.GetCraftingRecipeForType(itemType); if (itemCollector.Craftable(itemRecipe)) { btn.SetActive(true); btn.GetComponent <Button>().interactable = true; } else { btn.GetComponent <Button>().interactable = false; } } }
public void SetItemType(ItemType itemType) { this.itemType = itemType; this.craftingRecipe = ItemRegistry.GetCraftingRecipeForType(itemType); }