async void CreateSpatialAnchor(GameObject gameObject) {
// Add the component to a GameObject
var anchor = gameObject.AddComponent\<OVRSpatialAnchor\>();
// Wait for creation+localization
await anchor.WhenLocalizedAsync();
// Anchor is ready to use
Debug.Log($"Anchor created at {anchor.transform.position}");
}
Success | The operation succeeded. |
Failure | The operation failed with no additional details. |
Failure_ | The operation failed because the associated data is invalid. |
Failure_ | An invalid parameter was supplied to the operation, implicating early termination. |
Failure_ | The operation failed because saving anchors to cloud storage is not permitted by the user. |
Failure_ | The user was able to download the anchors, but the device was unable to localize itself in the spatial data received from the sharing device. |
Failure_ | The user was able to download the anchors, but the device was unable to localize them. |
Failure_ | Network operation timed out. |
Failure_ | Network operation failed. |
Failure_ | The operation failed because the Group UUID could not be found. |
async Task\<OVRSpatialAnchor\> CreateAnchor(GameObject gameObject) {
var anchor = gameObject.AddComponent\<OVRSpatialAnchor\>();
await anchor.WhenCreatedAsync();
return anchor;
}
async Task\<OVRSpatialAnchor\> CreateAnchor(GameObject gameObject) {
var anchor = gameObject.AddComponent\<OVRSpatialAnchor\>();
await anchor.WhenLocalizedAsync();
return anchor; // anchor is localized and ready to use
}
AddComponent\<OVRSpatialAnchor\>()
(List\<UnboundAnchor\> unboundAnchors, int startingIndex)