public DirectionBuilderView AddDirectiontBuilderView()
    {
        // make a new ingredient builder item
        DirectionBuilderView directionView = Instantiate(directionBuilderPrefab, directionVerticalGroupTrans).GetComponent <DirectionBuilderView>();

        // fire event for ui element change
        OnUIElementAdded?.Invoke();

        return(directionView);
    }
    public void prefillWithRecipe(Recipe recipe)
    {
        recipeImage.sprite      = recipe.ImageSprite;
        caloriesInputField.text = recipe.Calories.ToString();
        prepTimeInputField.text = recipe.PrepTimeMinutes.ToString();
        ingredientAmount.text   = recipe.Ingredients.Count.ToString();

        foreach (var ingredient in recipe.Ingredients)
        {
            IngredientBuilderView view = AddIngredientBuilderView();
            view.UpdateName(ingredient.IngredientName);
            view.UpdateAmount(ingredient.IngredientAmount);
        }

        foreach (var step in recipe.Steps)
        {
            DirectionBuilderView view = AddDirectiontBuilderView();
            view.SetDirection(step);
        }
    }