From e0fd0eac43e4c0820f571c0e60ca091e33d97fc4 Mon Sep 17 00:00:00 2001 From: magn9775 Date: Wed, 6 Mar 2024 09:25:36 +0100 Subject: [PATCH] idk L --- Assets/Scripts/Cooking.cs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Assets/Scripts/Cooking.cs b/Assets/Scripts/Cooking.cs index bd76e77..1fad0e3 100644 --- a/Assets/Scripts/Cooking.cs +++ b/Assets/Scripts/Cooking.cs @@ -7,29 +7,26 @@ public class Cooking : MonoBehaviour private string[] ingrediens = {"L","Egg"}; - + 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 currentCollisions = new List (); @@ -41,4 +38,11 @@ public class Cooking : MonoBehaviour currentCollisions.Remove (other.gameObject); } + + void Update() + { + GetIngredients(); + } + + }