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

View File

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