mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
perf: Use NetworkWriterPool in NetworkAnimator (#1421)
This commit is contained in:
parent
a4578458a1
commit
7d472f21f9
@ -88,10 +88,11 @@ void FixedUpdate()
|
||||
continue;
|
||||
}
|
||||
|
||||
NetworkWriter writer = new NetworkWriter();
|
||||
NetworkWriter writer = NetworkWriterPool.GetWriter();
|
||||
WriteParameters(writer);
|
||||
|
||||
SendAnimationMessage(stateHash, normalizedTime, i, writer.ToArray());
|
||||
NetworkWriterPool.Recycle(writer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,11 +137,12 @@ void CheckSendRate()
|
||||
{
|
||||
sendTimer = Time.time + syncInterval;
|
||||
|
||||
NetworkWriter writer = new NetworkWriter();
|
||||
NetworkWriter writer = NetworkWriterPool.GetWriter();
|
||||
if (WriteParameters(writer))
|
||||
{
|
||||
SendAnimationParametersMessage(writer.ToArray());
|
||||
}
|
||||
NetworkWriterPool.Recycle(writer);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user