Skip to content

Commit

Permalink
fix: fixing time being in ms instead of seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Dec 7, 2021
1 parent 162fb45 commit 7325e97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyVersion("3.1.1")]
[assembly: AssemblyVersion("3.1.2")]

[assembly: InternalsVisibleTo("JamesFrowen.PositionSync.Tests.Runtime")]
7 changes: 3 additions & 4 deletions source/SyncPositionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ private void ServerStarted()

private void LateUpdate()
{
timer?.Update();

syncTimer += timer.Delta;
// fixed atmost once a frame
// but always SyncRate per second
Expand All @@ -206,7 +204,8 @@ private void LateUpdate()
}
public void Update()
{
ClientUpdate(Time.unscaledDeltaTime);
timer?.Update();
ClientUpdate(timer.Delta);
}

private void ServerUpdate(float time)
Expand Down Expand Up @@ -556,7 +555,7 @@ public float Now

private float GetNow()
{
return (float)stopwatch.Elapsed.TotalMilliseconds;
return (float)(stopwatch.Elapsed.TotalMilliseconds / 1000f);
}

public void Update()
Expand Down

0 comments on commit 7325e97

Please sign in to comment.