Skip to content

Commit e8ba391

Browse files
countdown simplification
1 parent 33aeef2 commit e8ba391

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Assets/BossRoom/Scripts/Client/UI/IPConnectionWindow.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ IEnumerator DisplayUTPConnectionDuration(int maxReconnectAttempts, int connectTi
9191
{
9292
var connectionDuration = maxReconnectAttempts * connectTimeoutMS / 1000f;
9393

94-
while (connectionDuration > 0f)
94+
var seconds = Mathf.CeilToInt(connectionDuration);
95+
96+
while (seconds > 0)
9597
{
96-
m_TitleText.text = $"Connecting...\n{Mathf.CeilToInt(connectionDuration)}";
97-
connectionDuration -= Time.deltaTime;
98-
yield return null;
98+
m_TitleText.text = $"Connecting...\n{seconds}";
99+
yield return new WaitForSeconds(1f);
100+
seconds--;
99101
}
100102
m_TitleText.text = "Connecting...";
101103

0 commit comments

Comments
 (0)