This commit is contained in:
JesusLuvsYooh 2024-11-08 18:59:14 +08:00 committed by GitHub
commit a32631598e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,7 @@ void LateUpdate()
// instead. // instead.
if (isServer || (IsClientWithAuthority && NetworkClient.ready)) if (isServer || (IsClientWithAuthority && NetworkClient.ready))
{ {
if (sendIntervalCounter == sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct()))) if (sendIntervalCounter >= sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct())))
SetDirty(); SetDirty();
CheckLastSendTime(); CheckLastSendTime();
@ -129,7 +129,7 @@ protected virtual void CheckLastSendTime()
// timeAsDouble not available in older Unity versions. // timeAsDouble not available in older Unity versions.
if (AccurateInterval.Elapsed(NetworkTime.localTime, NetworkServer.sendInterval, ref lastSendIntervalTime)) if (AccurateInterval.Elapsed(NetworkTime.localTime, NetworkServer.sendInterval, ref lastSendIntervalTime))
{ {
if (sendIntervalCounter == sendIntervalMultiplier) if (sendIntervalCounter >= sendIntervalMultiplier)
sendIntervalCounter = 0; sendIntervalCounter = 0;
sendIntervalCounter++; sendIntervalCounter++;
} }