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()
|
||||
|
||||
23
Assets/Scripts/LevelManager.cs
Normal file
23
Assets/Scripts/LevelManager.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class LevelManager : MonoBehaviour
|
||||
{
|
||||
public int level;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
level = 1;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
private void Update() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
11
Assets/Scripts/LevelManager.cs.meta
Normal file
11
Assets/Scripts/LevelManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbc9dba12af11ea408751c79d0373658
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user