This commit is contained in:
magn9775
2024-03-06 09:25:36 +01:00
parent 1ab8cea2f5
commit e0fd0eac43

View File

@@ -7,29 +7,26 @@ public class Cooking : MonoBehaviour
private string[] ingrediens = {"L","Egg"}; private string[] ingrediens = {"L","Egg"};
void GetIngredients() void GetIngredients()
{ {
// foreach (GameObject ingredient in currentCollisions) {
// Debug.Log(ingredient.name);
// }
return currentCollisions return currentCollisions;
} }
void CheckDishes() void CheckDishes()
{ {
if (System.Array.IndexOf(ingrediens, "Egg")!=-1){ foreach (GameObject ingredient in currentCollisions) {
print("Egg");
Debug.Log(ingredient.name);
} }
} }
void Update()
{
GetIngredients();
}
// Keep track of ingredients going on and off the cooker. // Keep track of ingredients going on and off the cooker.
List <GameObject> currentCollisions = new List <GameObject> (); List <GameObject> currentCollisions = new List <GameObject> ();
@@ -41,4 +38,11 @@ public class Cooking : MonoBehaviour
currentCollisions.Remove (other.gameObject); currentCollisions.Remove (other.gameObject);
} }
void Update()
{
GetIngredients();
}
} }