API reference
API reference
Select your platform
No SDKs available
No versions available

SpatialAnchorCoreBuildingBlock Class

Extends MonoBehaviour
A helper class for creating, loading, and erasing a OVRSpatialAnchor easily.
See Editor/BuildingBlocks/BlockData/SampleSpatialAnchorController in the Meta XR Core SDK for an example of how to use this class.

Properties

This event will trigger after a call to InstantiateSpatialAnchor when the creation of the OVRSpatialAnchor is completed.
This event will trigger after a call to LoadAndInstantiateAnchors when the list of OVRSpatialAnchors is finished loading.
This should only be used for normal Spatial Anchors, use OnSharedSpatialAnchorsLoadCompleted for the Shared Spatial Anchor loaded event.
This event will trigger after a call to EraseAllAnchors when all the OVRSpatialAnchor(s) erasure is completed.
This event will trigger after a call to EraseAnchorByUuid when the OVRSpatialAnchor erasure is completed.

Member Functions

Creates and instantiates an OVRSpatialAnchor.
Use the OnAnchorCreateCompleted event to be notified when this operation is complete. Once the instantiation completed you can retrieve the OVRSpatialAnchor from the OnAnchorCreateCompleted callback. For more information, see Creating a New Spatial Anchor.
Parameters
prefab
A prefab to add the OVRSpatialAnchor component.
position
Position for the new anchor.
rotation
Orientation of the new anchor
Loads and instantiates anchors from a list of Guids.
Use the OnAnchorsLoadCompleted event to be notified when this operation is complete.
Parameters
prefab
Prefab for instantiating the loaded anchors.
uuids
List of anchor's Guid to load.
Exceptions
ArgumentNullException
Throws when uuids is null.
Erase all instantiated OVRSpatialAnchor(s).
It'll collect the uuid(s) of the instantiated OVRSpatialAnchor(s) and erase them. Use the OnAnchorsEraseAllCompleted event to be notified when this operation is complete. /remarks>
Erases an OVRSpatialAnchor by Guid.
Use the OnAnchorEraseCompleted event to be notified when this operation is completed.
Parameters
uuid
Anchor's uuid to erase.

Protected Functions

async Task WaitForInit
( OVRSpatialAnchor anchor )
async Task SaveAsync
( OVRSpatialAnchor anchor )
async void LoadAnchorsAsync
( GameObject prefab,
IEnumerable< Guid > uuids )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon