浏览代码

Update sample with new ARCollaborationData changes in Xcode 11 beta 3

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

24
Assets/Scenes/ARCollaborationData/TCPConnection.cs


if (collaborationData.valid)
{
using (collaborationData)
using (var bytes = collaborationData.ToNativeArray(Allocator.Temp))
SendData(stream, collaborationData.bytes);
SendData(stream, bytes);
}
}

{
m_CollaborationDataReadQueue.Enqueue(collaborationData);
}
// Only log critical data updates; optional updates can come every frame.
if (collaborationData.priority == ARCollaborationDataPriority.Critical)
{
Logger.Log($"Received {expectedLength} bytes from remote host.");
}
}
else
{

{
while (subsystem.collaborationDataCount > 0)
{
m_CollaborationDataSendQueue.Enqueue(subsystem.DequeueCollaborationData());
var collaborationData = subsystem.DequeueCollaborationData();
// As all data in this sample is sent over TCP, only send critical data
if (collaborationData.priority == ARCollaborationDataPriority.Critical)
{
m_CollaborationDataSendQueue.Enqueue(collaborationData);
}
unsafe void ProcessRemoteCollaborationData(ARKitSessionSubsystem subsystem)
{

{
using (var collaborationData = m_CollaborationDataReadQueue.Dequeue())
{
// Only notify user concerning large data sizes
if (collaborationData.bytes.Length > 1024)
{
Logger.Log($"Received {collaborationData.bytes.Length} bytes from remote host. Updating session.");
}
CollaborationNetworkingIndicator.NotifyIncomingDataReceived();
// Assume we only put in valid collaboration data into the queue.

正在加载...
取消
保存