mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-28 00:19:27 +00:00
make timesyncui count down
This commit is contained in:
parent
e1f94a862f
commit
d7de691807
@ -9,6 +9,8 @@ namespace QSB.TimeSync
|
||||
{
|
||||
public static TimeSyncUI Instance;
|
||||
|
||||
public static float TargetTime;
|
||||
|
||||
private Canvas _canvas;
|
||||
private Text _text;
|
||||
private float _startTime;
|
||||
@ -70,7 +72,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
var totalSeconds = Mathf.Max(Time.timeSinceLevelLoad - _startTime, 0f);
|
||||
var totalSeconds = Mathf.Max(TargetTime - Time.timeSinceLevelLoad, 0f);
|
||||
var minutes = Mathf.FloorToInt(totalSeconds / 60f);
|
||||
var seconds = Mathf.FloorToInt(totalSeconds) % 60;
|
||||
var text = "";
|
||||
|
@ -126,10 +126,12 @@ namespace QSB.TimeSync
|
||||
{
|
||||
if (_state == State.FastForwarding)
|
||||
{
|
||||
TimeSyncUI.TargetTime = _serverTime;
|
||||
return;
|
||||
}
|
||||
_timeScale = MaxFastForwardSpeed;
|
||||
_state = State.FastForwarding;
|
||||
TimeSyncUI.TargetTime = _serverTime;
|
||||
TimeSyncUI.Start(TimeSyncType.Fastforwarding);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user