mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Clamp fix
This commit is contained in:
parent
93dcc24ebe
commit
9cfd680c77
@ -130,7 +130,13 @@ public static double TimelineClamp(
|
||||
// outside of the area, we clamp.
|
||||
double lowerBound = targetTime - bufferTime;
|
||||
double upperBound = targetTime + bufferTime;
|
||||
#if UNITY_2021_OR_NEWER
|
||||
return Math.Clamp(localTimeline, lowerBound, upperBound);
|
||||
#else
|
||||
if (localTimeline.CompareTo(lowerBound) < 0) return lowerBound;
|
||||
else if (localTimeline.CompareTo(upperBound) > 0) return upperBound;
|
||||
else return localTimeline;
|
||||
#endif
|
||||
}
|
||||
|
||||
// call this for every received snapshot.
|
||||
|
Loading…
Reference in New Issue
Block a user