Partager via


XRAnchorTransferBatch.LoadAndReplaceAnchor(String, TrackableId) Method

Definition

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

public UnityEngine.XR.ARSubsystems.TrackableId LoadAndReplaceAnchor (string name, UnityEngine.XR.ARSubsystems.TrackableId trackableId);
member this.LoadAndReplaceAnchor : string * UnityEngine.XR.ARSubsystems.TrackableId -> UnityEngine.XR.ARSubsystems.TrackableId
Public Function LoadAndReplaceAnchor (name As String, trackableId As TrackableId) As TrackableId

Parameters

name
String

The anchor's identifier from the transfer batch.

trackableId
UnityEngine.XR.ARSubsystems.TrackableId

The existing Unity anchor to update to track this new spatial anchor.

Returns

UnityEngine.XR.ARSubsystems.TrackableId

The UnityEngine.XR.ARSubsystems.TrackableId of the resulting Unity anchor (usually the same as the passed-in parameter) if successfully loaded, or TrackableId.invalidId if the given name is not found.

Applies to