This commit is contained in:
2024-04-27 13:32:54 +02:00
parent efdc5818e3
commit 54378a55ec

View File

@@ -91,22 +91,22 @@ public class Cooking : MonoBehaviour
DishesCooked.Add(BestDish); DishesCooked.Add(BestDish);
// Find used ingredients
List <GameObject> IngredientsInDish = BestDish.GetComponent<Dish>().RequiredIngredients;
List <GameObject> UsedIngredients = new();
List <GameObject> UnusedIngredients = new();
foreach (GameObject Ingredient in Ingredients) {
if (IngredientsInDish.Contains(Ingredient)) {
UsedIngredients.Add(Ingredient);
}
else {
UnusedIngredients.Add(Ingredient);
}
}
// old code // old code
// // Find used ingredients
// List <GameObject> IngredientsInDish = BestDish.GetComponent<Dish>().RequiredIngredients;
// List <GameObject> UsedIngredients = new();
// List <GameObject> UnusedIngredients = new();
// foreach (GameObject Ingredient in Ingredients) {
// if (IngredientsInDish.Contains(Ingredient)) {
// UsedIngredients.Add(Ingredient);
// }
// else {
// UnusedIngredients.Add(Ingredient);
// }
// }
//-------------------------------------- //--------------------------------------
// // Remove ingredients and add the dish // // Remove ingredients and add the dish
// foreach (GameObject Ingredient in UsedIngredients) { // foreach (GameObject Ingredient in UsedIngredients) {