mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
perf: Use NetworkWriterPool in NetworkTransform (#1422)
This commit is contained in:
parent
b9f52fdb46
commit
a4578458a1
@ -380,11 +380,12 @@ void Update()
|
||||
{
|
||||
// serialize
|
||||
// local position/rotation for VR support
|
||||
NetworkWriter writer = new NetworkWriter();
|
||||
NetworkWriter writer = NetworkWriterPool.GetWriter();
|
||||
SerializeIntoWriter(writer, targetComponent.transform.localPosition, targetComponent.transform.localRotation, compressRotation, targetComponent.transform.localScale);
|
||||
|
||||
// send to server
|
||||
CmdClientToServerSync(writer.ToArray());
|
||||
NetworkWriterPool.Recycle(writer);
|
||||
}
|
||||
lastClientSendTime = Time.time;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user