Skip to content

Commit

Permalink
fix: stopping warnings from use of Obsolete InterpolationTimeField
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Feb 23, 2024
1 parent a48ecd0 commit 051e618
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Assets/NetworkPositionSync/Runtime/SyncPositionBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ private void OnGUI()
{
if (showDebugGui)
{
var delay = _system.TimeSync.LatestServerTime - _system.TimeSync.InterpolationTimeField;
var delay = _system.TimeSync.LatestServerTime - _system.TimeSync.Time;
timeDelayAvg.Add(delay);
GUILayout.Label($"ServerTime: {_system.TimeSync.LatestServerTime:0.000}");
GUILayout.Label($"InterpTime: {_system.TimeSync.InterpolationTimeField:0.000}");
GUILayout.Label($"InterpTime: {_system.TimeSync.Time:0.000}");
GUILayout.Label($"Time Delta: {delay:0.000} smooth:{timeDelayAvg.Value:0.000} scale:{_system.TimeSync.DebugScale:0.000}");
GUILayout.Label(snapshotBuffer.ToDebugString(_system.TimeSync.InterpolationTimeField));
GUILayout.Label(snapshotBuffer.ToDebugString(_system.TimeSync.Time));
}
}
#endif
Expand Down Expand Up @@ -414,7 +414,7 @@ private void ClientInterpolation()
if (snapshotBuffer.IsEmpty)
return;

var snapshotTime = _system.TimeSync.InterpolationTimeField;
var snapshotTime = _system.TimeSync.Time;
var state = snapshotBuffer.GetLinearInterpolation(snapshotTime);
// todo add trace log
if (logger.LogEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void Update()
var pos = snapshot.state.position;
var hash = (pos.x * 501) + pos.z;
markers[i].GetComponent<Renderer>().material.color = Color.HSVToRGB(hash * 20 % 1, 1, 1);
var snapshotTime = _system.TimeSync.InterpolationTimeField;
var snapshotTime = _system.TimeSync.Time;

var absTimeDiff = Mathf.Abs((float)(snapshotTime - snapshot.time));
var sizeFromDiff = Mathf.Clamp01((maxTime - absTimeDiff) / maxTime);
Expand Down

0 comments on commit 051e618

Please sign in to comment.