Clamp fix

This commit is contained in:
MrGadget1024 2023-03-12 09:49:28 -04:00
parent 93dcc24ebe
commit 9cfd680c77

View File

@ -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.