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

SharedSpatialAnchorCore Class

A helper class for creating, loading, erasing, and sharing a OVRSpatialAnchor easily.
Use LoadAndInstantiateAnchors to load an instantiate a list of anchors, and OnSharedSpatialAnchorsLoadCompleted to be notified when the loading is completed. Use InstantiateSpatialAnchor to create an instantiate a single anchor based on a prefab. Use ShareSpatialAnchors to share a list of anchors, and OnSpatialAnchorsShareCompleted to be notified when the sharing is completed. See Building Blocks for more information.

Properties

OnSharedSpatialAnchorsLoadCompleted : UnityEvent< List< OVRSpatialAnchor >, OVRSpatialAnchor.OperationResult >
[Get][Set]
This event will be triggered when the loading of a list of shared OVRSpatialAnchor(s) is completed.
Signature
UnityEvent<List<OVRSpatialAnchor>, OVRSpatialAnchor.OperationResult> OnSharedSpatialAnchorsLoadCompleted
OnSpatialAnchorsShareCompleted : UnityEvent< List< OVRSpatialAnchor >, OVRSpatialAnchor.OperationResult >
[Get][Set]
This event will be triggered when the sharing of a list of OVRSpatialAnchor(s) is completed.
Signature
UnityEvent<List<OVRSpatialAnchor>, OVRSpatialAnchor.OperationResult> OnSpatialAnchorsShareCompleted

Methods

InstantiateSpatialAnchor ( prefab , position , rotation )
Create and instantiate an OVRSpatialAnchor.
Signature
async new void InstantiateSpatialAnchor(GameObject prefab, Vector3 position, Quaternion rotation)
Parameters
prefab: GameObject  A prefab to instantiate as a OVRSpatialAnchor.
position: Vector3  Initial position of instantiated GameObject.
rotation: Quaternion  Initial rotation of instantiated GameObject.
Returns
async new void
LoadAndInstantiateAnchors ( prefab , uuids )
Loads and instantiates OVRSpatialAnchor(s) from a list of Guids.
Use OnSharedSpatialAnchorsLoadCompleted to be notified when the loading is completed.
Signature
new void LoadAndInstantiateAnchors(GameObject prefab, List< Guid > uuids)
Parameters
prefab: GameObject  A prefab to instantiate as a OVRSpatialAnchor.
uuids: List< Guid >  A list of Guid(s) to load.
Returns
new void
Throws
ArgumentNullException  Throws when uuids is null. ArgumentException  Throws when uuids list is empty.
ShareSpatialAnchors ( anchors , users )
Shares a list of OVRSpatialAnchor(s) with a list of OVRSpaceUser(s).
Use OnSpatialAnchorsShareCompleted to be notified when the sharing is completed.
Use OnSpatialAnchorsShareCompleted to be notified when the sharing is completed.
Signature
void ShareSpatialAnchors(List< OVRSpatialAnchor > anchors, List< OVRSpaceUser > users)
Parameters
anchors: List< OVRSpatialAnchor >  A list of OVRSpatialAnchor(s) to share.
users: List< OVRSpaceUser >  A list of OVRSpaceUser to share OVRSpatialAnchor(s) with.
Returns
void
Throws
ArgumentNullException  Throws when anchors or users is null. ArgumentException  Throws when anchors or users list is empty.