Partager via


XRAnchorTransferBatch Class

Definition

Provides the ability to build up a batch of anchors and export them to a binary stream for transfer. Typically on a second device, it then supports importing the transfer stream and loading in the original batch of anchors.

public class XRAnchorTransferBatch
type XRAnchorTransferBatch = class
Public Class XRAnchorTransferBatch
Inheritance
XRAnchorTransferBatch

Remarks

Use of this class requires an ARAnchorManager in the scene or some other manual management of an XRAnchorSubsystem.

Constructors

XRAnchorTransferBatch()

Constructor.

Properties

AnchorNames

Provides a list of all identifiers currently mapped in this AnchorTransferBatch.

Methods

AddAnchor(TrackableId, String)

Tries to convert and add an anchor with the corresponding UnityEngine.XR.ARSubsystems.TrackableId to an export list.

Clear()

Removes all anchors from the transfer batch. Doesn't remove any existing Unity anchors, if present.

ExportAsync(XRAnchorTransferBatch)

Exports any anchors added via AddAnchor(TrackableId, String) into a Stream for transfer. Use ImportAsync(Stream) for reading this Stream.

ImportAsync(Stream)

Imports the provided Stream into an XRAnchorTransferBatch.

LoadAnchor(String)

Attempts to load a specified anchor from the transfer batch and reports it to Unity as an XRAnchor/ARAnchor.

LoadAndReplaceAnchor(String, TrackableId)

Attempts to load a specified anchor from the transfer batch and replace the specified Unity anchor's tracking data with the new anchor.

RemoveAnchor(String)

Removes an anchor from the transfer batch. Doesn't remove the existing Unity anchor, if one is present.

Applies to