Fix shop System

add food indicator
This commit is contained in:
Vladimir Koshevarov
2022-11-17 17:24:00 +02:00
parent be3161d7e4
commit c8047bd170
16 changed files with 663 additions and 286 deletions
+51
View File
@@ -0,0 +1,51 @@
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class GameUIManager : MonoBehaviour
{
[SerializeField]
private PlayerManager _playerController;
[SerializeField]
private TextMeshProUGUI _timeText;
[SerializeField]
private TextMeshProUGUI _moneyText;
[SerializeField]
public Slider _energy;
[SerializeField]
public Slider _food;
// Start is called before the first frame update
private void OnEnable()
{
TimeManager.OnMinuteChanged += UpdateTime;
}
private void OnDisable()
{
TimeManager.OnMinuteChanged -= UpdateTime;
}
// Update is called once per frame
void Update()
{
_moneyText.text = $"${_playerController.money.Value}";
}
private void UpdateTime()
{
if (_timeText != null)
{
_timeText.text = TimeManager.CurrentTime.ToString(@"hh\:mm");
}
_energy.value = _playerController.energy.Value;
_food.value = _playerController.food.Value;
}
}