private void OnHumanBodiesChanged(ARHumanBodiesChangedEventArgs args) { info = new ARKitRemotePacket.HumanBodyInfo(); info.added = args.added.Select(humanBody => ToHumanBody(humanBody)).ToArray(); info.updated = args.updated.Select(humanBody => ToHumanBody(humanBody)).ToArray(); info.removed = args.removed.Select(humanBody => (ARKitStream.Internal.TrackableId)humanBody.trackableId).ToArray(); var joints = new Dictionary <TrackableId, byte[]>(); foreach (var humanBody in args.added) { joints.Add(humanBody.trackableId, humanBody.joints.ToRawBytes()); } foreach (var humanBody in args.updated) { joints.Add(humanBody.trackableId, humanBody.joints.ToRawBytes()); } info.joints = joints; }
protected override void OnPacketTransformer(ARKitRemotePacket packet) { packet.humanBody = info; info = null; }