L
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user