Skip to content

Commit

Permalink
Fixed timer between instances
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaar authored Mar 4, 2023
1 parent 9a7a199 commit 2024bd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mainscript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public void InitializeTimer()
case 3:
insideTimeCount = float.Parse(fileContents);
initialTimeIn = insideTimeCount;
runTimeOnLoadEnd = insideTimeCount;
TimeCountStart = currentElapsedTime;
break;
case 4:
outsideTimeCount = float.Parse(fileContents);
Expand Down Expand Up @@ -275,8 +277,7 @@ public void Update()
//
saveSystemTime = DateTime.Now;
// Since realtimeSinceStartup depends on when in the frame you are we'll define it at the beginning of each frame
// Also this is where you should change if you want to change the timing method to a different one like Time.time
currentElapsedTime = Time.realtimeSinceStartup;
currentElapsedTime = realtimeSinceStartup;
//Save the time variable (don't do it at LateUpdate because there it'll save the time of almost the next frame)
if (!isMainInstance)
{
Expand Down

0 comments on commit 2024bd9

Please sign in to comment.