NetworkClient/Server Broadcast: make this easier to read

This commit is contained in:
mischa 2024-07-27 10:03:20 +02:00
parent bb552f8a54
commit 0c213fbce4
2 changed files with 4 additions and 3 deletions

View File

@ -1598,8 +1598,8 @@ internal static void NetworkLateUpdate()
// snapshots _but_ not every single tick.
//
// Unity 2019 doesn't have Time.timeAsDouble yet
if (!Application.isPlaying ||
AccurateInterval.Elapsed(NetworkTime.localTime, sendInterval, ref lastSendTime))
bool sendIntervalElapsed = AccurateInterval.Elapsed(NetworkTime.localTime, sendInterval, ref lastSendTime);
if (!Application.isPlaying || sendIntervalElapsed)
{
Broadcast();
}

View File

@ -2034,7 +2034,8 @@ internal static void NetworkLateUpdate()
// NetworkTransform, so they can sync on same interval as time
// snapshots _but_ not every single tick.
// Unity 2019 doesn't have Time.timeAsDouble yet
if (!Application.isPlaying || AccurateInterval.Elapsed(NetworkTime.localTime, sendInterval, ref lastSendTime))
bool sendIntervalElapsed = AccurateInterval.Elapsed(NetworkTime.localTime, sendInterval, ref lastSendTime);
if (!Application.isPlaying || sendIntervalElapsed)
Broadcast();
}