food position fix
This commit is contained in:
@@ -15,6 +15,7 @@ public class Cooking : MonoBehaviour
|
||||
// }
|
||||
|
||||
public Vector3 FinishedDishPosition;
|
||||
public GameObject AllIngredients;
|
||||
|
||||
public void CreateDish() {
|
||||
List <GameObject> Ingredients = GetIngredients();
|
||||
@@ -29,8 +30,6 @@ public class Cooking : MonoBehaviour
|
||||
|
||||
foreach (GameObject Ingredient in Ingredients) {
|
||||
|
||||
Debug.Log(Ingredient.name);
|
||||
|
||||
List <GameObject> Dishes = Ingredient.GetComponent<Ingredient>().IngredientIn;
|
||||
|
||||
foreach (GameObject Dish in Dishes) {
|
||||
@@ -97,14 +96,27 @@ public class Cooking : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Remove ingredients and add the dish
|
||||
// // Remove ingredients and add the dish
|
||||
// foreach (GameObject Ingredient in UsedIngredients) {
|
||||
// Transform transform = Ingredient.GetComponent<Ingredient>().transform;
|
||||
// transform.position = Vector3.up * 50;
|
||||
// }
|
||||
|
||||
BestDish.transform.position = FinishedDishPosition;
|
||||
|
||||
foreach (GameObject Ingredient in UsedIngredients) {
|
||||
Transform transform = Ingredient.GetComponent<Ingredient>().transform;
|
||||
transform.position = Vector3.up * 50;
|
||||
}
|
||||
|
||||
BestDish.transform.position = FinishedDishPosition;
|
||||
// Return ingredients to table
|
||||
|
||||
for (int i = 0; i < AllIngredients.transform.childCount; i++)
|
||||
{
|
||||
GameObject ingredient = AllIngredients.transform.GetChild(i).gameObject;
|
||||
|
||||
ingredient.GetComponent<Ingredient>().ResetPosition();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user