Fix elapsed time being counted twice on first frame

This commit is contained in:
Dean Herbert 2023-12-27 00:11:22 +09:00
parent 225528d519
commit d70fddb6fd
No known key found for this signature in database
1 changed files with 4 additions and 2 deletions

View File

@ -227,8 +227,10 @@ private void checkPlaybackValidity()
{
elapsedGameplayClockTime += GameplayClock.ElapsedFrameTime;
elapsedValidationTime ??= elapsedGameplayClockTime;
elapsedValidationTime += GameplayClock.Rate * Time.Elapsed;
if (elapsedValidationTime == null)
elapsedValidationTime = elapsedGameplayClockTime;
else
elapsedValidationTime += GameplayClock.Rate * Time.Elapsed;
if (Math.Abs(elapsedGameplayClockTime - elapsedValidationTime!.Value) > 300)
{