sleeping ui dialog
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user