API reference

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
OnSpatialAnchorsShareToGroupCompleted : UnityEvent< List< OVRSpatialAnchor >, OVRAnchor.ShareResult >
[Get][Set]
Signature
UnityEvent<List<OVRSpatialAnchor>, OVRAnchor.ShareResult> OnSpatialAnchorsShareToGroupCompleted

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
override async 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
override async void
Throws
ArgumentNullException  Throws when uuids is null. ArgumentException  Throws when uuids list is empty.
LoadAndInstantiateAnchorsFromGroup ( prefab , groupUuid )
Loads and instantiates OVRSpatialAnchor(s) from a ColocationSession group represented by Guid.
Use OnSharedSpatialAnchorsLoadCompleted to be notified when the loading is completed.
Signature
async void LoadAndInstantiateAnchorsFromGroup(GameObject prefab, Guid groupUuid)
Parameters
prefab: GameObject  A prefab to instantiate as a OVRSpatialAnchor.
groupUuid: Guid  Representing the ColocationSession group used for retrieve the anchors.
Returns
async void
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.
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.
ShareSpatialAnchors ( anchors , groupUuid )
Shares a list of OVRSpatialAnchor(s) with a ColocationSession group represented by a Guid.
Use OnSpatialAnchorsShareToGroupCompleted to be notified when the sharing is completed.
Signature
void ShareSpatialAnchors(List< OVRSpatialAnchor > anchors, Guid groupUuid)
Parameters
anchors: List< OVRSpatialAnchor >  A list of OVRSpatialAnchor(s) to share.
groupUuid: Guid  A group uuid to share the anchors with.
Returns
void
Throws
ArgumentNullException  Throws when anchors is null. ArgumentException  Throws when anchors list is empty.