Added crazy Dish ui screen
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Unity.VisualStudio.Editor;
|
||||
using UnityEngine;
|
||||
|
||||
public class Cooking : MonoBehaviour
|
||||
@@ -14,6 +15,7 @@ public class Cooking : MonoBehaviour
|
||||
|
||||
// }
|
||||
|
||||
|
||||
public Vector3 FinishedDishPosition;
|
||||
public GameObject AllIngredients;
|
||||
|
||||
@@ -96,18 +98,17 @@ public class Cooking : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// old code
|
||||
//--------------------------------------
|
||||
// // 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
|
||||
|
||||
@@ -118,6 +119,13 @@ public class Cooking : MonoBehaviour
|
||||
ingredient.GetComponent<Ingredient>().ResetPosition();
|
||||
}
|
||||
|
||||
// Show dish ui screen
|
||||
Sprite DishImage = BestDish.GetComponent<SpriteRenderer>().sprite;
|
||||
int Stars = 3;
|
||||
string DishName = BestDish.name;
|
||||
|
||||
gameObject.GetComponent<DishUI>().ShowUI(DishName, DishImage, Stars);
|
||||
|
||||
}
|
||||
|
||||
// Keep track of ingredients going on and off the cooker.
|
||||
|
||||
Reference in New Issue
Block a user