Finished cooking function
This commit is contained in:
@@ -14,6 +14,8 @@ public class Cooking : MonoBehaviour
|
||||
|
||||
// }
|
||||
|
||||
public Vector3 FinishedDishPosition;
|
||||
|
||||
void CreateDish() {
|
||||
List <GameObject> Ingredients = GetIngredients();
|
||||
|
||||
@@ -74,12 +76,19 @@ public class Cooking : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log(BestDish.name);
|
||||
// Remove ingredients and add the dish
|
||||
foreach (GameObject Ingredient in Ingredients) {
|
||||
Transform transform = Ingredient.GetComponent<Ingredient>().transform;
|
||||
transform.position = Vector3.up * 50;
|
||||
}
|
||||
|
||||
BestDish.transform.position = FinishedDishPosition;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Keep track of ingredients going on and off the cooker.
|
||||
List <GameObject> currentCollisions = new List <GameObject> ();
|
||||
List <GameObject> currentCollisions = new List <GameObject>();
|
||||
private void OnTriggerEnter2D(Collider2D other) {
|
||||
currentCollisions.Add (other.gameObject);
|
||||
CreateDish();
|
||||
|
||||
Reference in New Issue
Block a user