private void UpdateUI(int index, Item.Type type, int amount)
 {
     for (int i = 0; i < recipeObjects.Count; i++)
     {
         RecipeUIObject recipeObject = recipeObjects[i];
         recipeObject.UpdateCraftableIndicator();
         if (recipeObject != LastRecipeHovered)
         {
             continue;
         }
         recipeObject.UpdateTooltip(tooltip);
     }
 }
        public void Setup()
        {
            //disable crafting UI if these conditions are met
            if (crafter == null || crafter.GetRecipeStorage == null)
            {
                craftingDisabledObject.SetActive(true);
                recipeContent.gameObject.SetActive(false);
                craftingDisabledReason.text = "Unit cannot craft";
            }
            else if (crafter.GetRecipeStorage.RecipeCount == 0)
            {
                craftingDisabledObject.SetActive(true);
                recipeContent.gameObject.SetActive(false);
                craftingDisabledReason.text = "Unit has no crafting recipes";
            }
            else
            {
                craftingDisabledObject.SetActive(false);
                recipeContent.gameObject.SetActive(true);

                foreach (Transform child in recipeContent)
                {
                    Destroy(child.gameObject);
                }
                recipeObjects.Clear();

                //fill up recipe area with units currently accessible recipes
                List <CraftingRecipe> recipes = crafter.GetRecipeStorage.recipes;
                for (int i = 0; i < recipes.Count; i++)
                {
                    RecipeUIObject recipeObject = Instantiate(
                        recipeObjectPrefab, recipeContent);
                    recipeObject.Initialise(this, recipes[i], crafter);
                    recipeObjects.Add(recipeObject);
                }
            }
        }
 public void OnHoverExitRecipeObject(RecipeUIObject recipeUIObj)
 {
     tooltip.Hide();
 }
 public void OnHoverEnterRecipeObject(RecipeUIObject recipeUIObj)
 {
     LastRecipeHovered = recipeUIObj;
     recipeUIObj.UpdateTooltip(tooltip);
     tooltip.Show();
 }