perf: Use NetworkWriterPool in NetworkTransform (#1422)

This commit is contained in:
MrGadget 2020-01-10 19:09:27 -05:00 committed by Paul Pacheco
parent b9f52fdb46
commit a4578458a1

View File

@ -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;
}