mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
perf: Changed not virtual and inline
This commit is contained in:
parent
1ef00f9d44
commit
5efba8b923
@ -197,7 +197,8 @@ protected virtual void ApplySnapshot(TransformSnapshot interpolated)
|
|||||||
|
|
||||||
// check if position / rotation / scale changed since last _full reliable_ sync.
|
// check if position / rotation / scale changed since last _full reliable_ sync.
|
||||||
// squared comparisons for performance
|
// squared comparisons for performance
|
||||||
protected virtual bool Changed(TransformSnapshot current)
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
bool Changed(TransformSnapshot current)
|
||||||
{
|
{
|
||||||
// if (syncPosition && Vector3.Distance(last.position, current.position) >= positionPrecision)
|
// if (syncPosition && Vector3.Distance(last.position, current.position) >= positionPrecision)
|
||||||
if (syncPosition && (current.position - last.position).sqrMagnitude >= positionPrecisionSqr)
|
if (syncPosition && (current.position - last.position).sqrMagnitude >= positionPrecisionSqr)
|
||||||
|
Loading…
Reference in New Issue
Block a user