Share via


XRAnchorStore Class

Definition

Handles persisting anchors from the scene to the anchor store, loading anchors from the anchor store to the scene, and managing anchors persisted in the anchor store.

public class XRAnchorStore
type XRAnchorStore = class
Public Class XRAnchorStore
Inheritance
XRAnchorStore

Remarks

Persisting and unpersisting anchors from the anchor store does not affect their state in the Unity scene. These operations only affect whether anchors will be available to load from the anchor store in the future.

Properties

PersistedAnchorNames

The names of all persisted anchors available in this anchor store. Each of these persisted anchors can be loaded with LoadAnchor(String).

Methods

Clear()

Clear all persisted anchors from the anchor store.

LoadAnchor(String)

Begin loading an anchor from the anchor store into the Unity scene. On a future update of the ARAnchorManager or XRAnchorSubsystem, a new corresponding anchor will be created.

LoadAnchorStoreAsync(XRAnchorSubsystem)
LoadAsync(XRAnchorSubsystem)
Obsolete.
Obsolete.
Obsolete.

Deprecated: Uses an existing UnityEngine.XR.ARSubsystems.XRAnchorSubsystem to load an XRAnchorStore.

TryPersistAnchor(TrackableId, String)

Persist an anchor in the anchor store, where it can be retrieved using LoadAnchor(String).

TryReloadAnchorStoreAsync()

This method will reload the anchor store. Use this if the head tracking map or anchors changed from outside the application.

UnpersistAnchor(String)

Unpersist an anchor from the anchor store.

Applies to