Added score text
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Unity.VisualStudio.Editor;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Cooking : MonoBehaviour
|
||||
{
|
||||
@@ -14,10 +16,20 @@ public class Cooking : MonoBehaviour
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public Vector3 FinishedDishPosition;
|
||||
public GameObject AllIngredients;
|
||||
public int requiredScore = 5;
|
||||
public TextMeshProUGUI UserScoreText;
|
||||
public TextMeshProUGUI RequredScoreText;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
UserScoreText.text = "0";
|
||||
RequredScoreText.text = requiredScore.ToString();
|
||||
}
|
||||
|
||||
public void CreateDish() {
|
||||
List <GameObject> Ingredients = GetIngredients();
|
||||
@@ -126,6 +138,8 @@ public class Cooking : MonoBehaviour
|
||||
|
||||
gameObject.GetComponent<DishUI>().ShowUI(DishName, DishImage, Stars);
|
||||
|
||||
UpdateUserScore(Stars);
|
||||
|
||||
}
|
||||
|
||||
// Keep track of ingredients going on and off the cooker.
|
||||
@@ -147,6 +161,10 @@ public class Cooking : MonoBehaviour
|
||||
}
|
||||
return Ingredients;
|
||||
}
|
||||
private void UpdateUserScore(int score)
|
||||
{
|
||||
UserScoreText.text = score.ToString();
|
||||
}
|
||||
|
||||
|
||||
// void Update()
|
||||
|
||||
Reference in New Issue
Block a user