mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
blendingstarttime: use .localtime (faster)
This commit is contained in:
parent
9b92113648
commit
d656239476
@ -160,7 +160,7 @@ protected void BeginBlending()
|
|||||||
{
|
{
|
||||||
state = ForecastState.BLENDING;
|
state = ForecastState.BLENDING;
|
||||||
// if (debugColors) rend.material.color = blendingAheadColor; set in update depending on ahead/behind
|
// if (debugColors) rend.material.color = blendingAheadColor; set in update depending on ahead/behind
|
||||||
blendingStartTime = NetworkTime.time;
|
blendingStartTime = NetworkTime.localTime;
|
||||||
OnBeginBlending();
|
OnBeginBlending();
|
||||||
// Debug.Log($"{name} BEGIN BLENDING");
|
// Debug.Log($"{name} BEGIN BLENDING");
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ void FixedUpdateClient()
|
|||||||
|
|
||||||
// sample the blending curve to find out how much to blend right now
|
// sample the blending curve to find out how much to blend right now
|
||||||
|
|
||||||
float blendingElapsed = (float)(NetworkTime.time - blendingStartTime);
|
float blendingElapsed = (float)(NetworkTime.localTime - blendingStartTime);
|
||||||
float relativeElapsed = blendingElapsed / blendingTime;
|
float relativeElapsed = blendingElapsed / blendingTime;
|
||||||
float p = blendingCurve.Evaluate(relativeElapsed);
|
float p = blendingCurve.Evaluate(relativeElapsed);
|
||||||
// Debug.Log($"{name} BLENDING @ {blendingElapsed:F2} / {blendingTime:F2} => {(p*100):F0}%");
|
// Debug.Log($"{name} BLENDING @ {blendingElapsed:F2} / {blendingTime:F2} => {(p*100):F0}%");
|
||||||
|
Loading…
Reference in New Issue
Block a user