void OnFaceChanged(ARFacesChangedEventArgs args) { var subsystem = faceManager.subsystem as ARKitFaceSubsystem; info = new ARKitRemotePacket.FaceInfo(); info.added = args.added.Select(face => ToARFace(face)).ToArray(); info.updated = args.updated.Select(face => ToARFace(face)).ToArray(); info.removed = args.removed.Select(face => (ARKitStream.Internal.TrackableId)face.trackableId).ToArray(); var meshes = new List <ARKitRemotePacket.FaceMesh>(); meshes.AddRange(args.added.Select(face => ToMesh(face, subsystem))); meshes.AddRange(args.updated.Select(face => ToMesh(face, subsystem))); // removed meshes are not needed // meshes.AddRange(args.removed.Select(face => ToMesh(face))); info.meshes = meshes.ToArray(); }
protected override void OnPacketTransformer(ARKitRemotePacket packet) { packet.face = info; info = null; }