Refactor: added GameManager

This commit is contained in:
Vova
2023-12-11 11:53:00 +02:00
parent 05bf8484f5
commit ea59babf93
23 changed files with 162 additions and 643 deletions
+3 -3
View File
@@ -24,12 +24,12 @@ public class TopBarUI : MonoBehaviour
// Start is called before the first frame update
private void Start()
{
TimeManager.Instance.OnMinuteChanged += UpdateTime;
GameManager.Instance.Time.OnMinuteChanged += UpdateTime;
}
private void OnDisable()
{
TimeManager.Instance.OnMinuteChanged -= UpdateTime;
GameManager.Instance.Time.OnMinuteChanged -= UpdateTime;
}
// Update is called once per frame
@@ -44,7 +44,7 @@ public class TopBarUI : MonoBehaviour
{
if (_timeText != null)
{
_timeText.text = $"{TimeManager.CurrentTime.GetDayName()} {TimeManager.CurrentTime.ToString(@"hh\:mm")} day ({TimeManager.CurrentTime.Days})";
_timeText.text = $"{GameManager.Instance.Time.CurrentTime.GetDayName()} {GameManager.Instance.Time.CurrentTime.ToString(@"hh\:mm")} day ({GameManager.Instance.Time.CurrentTime.Days})";
}
_energy.value = (Player.Instance.Stats[StatsId.Energy] as INumericStat).Value;