sleeping ui dialog

This commit is contained in:
2023-03-14 20:53:29 +02:00
parent 500b250001
commit 3a94a6182e
5 changed files with 1838 additions and 30 deletions
+17 -3
View File
@@ -34,7 +34,7 @@ public class TimeManager : MonoBehaviour
private TimeSpan _timeToStop;
private Action _callBackOnFastForward;
private bool _isPause = false;
private void Awake()
{
@@ -62,8 +62,11 @@ public class TimeManager : MonoBehaviour
// Update is called once per frame
void Update()
{
UpdateTime();
RotateSun();
if (!_isPause)
{
UpdateTime();
RotateSun();
}
}
private void UpdateTime()
@@ -86,6 +89,7 @@ public class TimeManager : MonoBehaviour
public void FastForward(TimeSpan timeToStop,Action callBack)
{
_isPause = false;
_timeToStop = _currentTime.Add(timeToStop);
_minuteToRealTime = 0.03f;
_callBackOnFastForward= callBack;
@@ -120,4 +124,14 @@ public class TimeManager : MonoBehaviour
return diff;
}
public void Pause()
{
_isPause = true;
}
internal void Resume()
{
_isPause = false;
}
}