public void LoadDish(string dishName) { dishImage.GetComponent <Image>().sprite = ReturnImage(dishName); currentDish = DishData.LoadJSON(dishName + ".json"); Debug.Log("The name of the dish we are loading is " + currentDish.dishName); currentRecipe = new Recipe(currentDish.requiredFoodSlots.Count + currentDish.optionalFoodSlots.Count); }
public void RetriveDishInfo(string savedRecipieName) { Recipe recipeToEdit = null; for (int i = 0; i < gameController.activePlayer.savedRecipies.Count; i++) { if (gameController.activePlayer.savedRecipies[i].name == savedRecipieName) { recipeToEdit = gameController.activePlayer.savedRecipies[i]; } } if (recipeToEdit != null) { currentDish = DishData.LoadJSON(recipeToEdit.dishTemplate); TurnOnPanels(); CreateSlots(); //TODO: Fill the slots with what the recipe already has } }