浏览代码

Remove ToArray; use ToSerialized instead for fewer copies

/3.1
Tim Mowrer 5 年前
当前提交
b6ffbea1
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 6
      Assets/Scenes/ARCollaborationData/TCPConnection.cs

6
Assets/Scenes/ARCollaborationData/TCPConnection.cs


if (collaborationData.valid)
{
using (collaborationData)
using (var bytes = collaborationData.ToNativeArray(Allocator.Persistent))
using (var serializedData = collaborationData.ToSerialized())
// We use Allocator.Persistent above because sending data
// can take several frames, so TempJob cannot be used.
SendData(stream, bytes);
SendData(stream, serializedData);
}
}

正在加载...
取消
保存