diff --git a/Assets/Scripts/Cooking.cs b/Assets/Scripts/Cooking.cs index 8f0699e..bd76e77 100644 --- a/Assets/Scripts/Cooking.cs +++ b/Assets/Scripts/Cooking.cs @@ -5,6 +5,10 @@ using UnityEngine; public class Cooking : MonoBehaviour { + private string[] ingrediens = {"L","Egg"}; + + + void GetIngredients() { @@ -15,6 +19,12 @@ public class Cooking : MonoBehaviour return currentCollisions } + void CheckDishes() + { + if (System.Array.IndexOf(ingrediens, "Egg")!=-1){ + print("Egg"); + } + } void Update() { @@ -25,6 +35,7 @@ public class Cooking : MonoBehaviour List currentCollisions = new List (); private void OnTriggerEnter2D(Collider2D other) { currentCollisions.Add (other.gameObject); + CheckDishes(); } private void OnTriggerExit2D(Collider2D other) { currentCollisions.Remove (other.gameObject);