How to initialize a CloudSpatialAnchorSession?
Import AzureSpacialAnchors asset into your script.
using Microsoft.Azure.SpatialAnchors;Add the CloudSpatialAnchorSession and CloudSpatialAnchor member variables into your
AzureSpatialAnchorsScriptclass:
/// <summary>
/// Use the recognizer to detect air taps.
/// </summary>
private GestureRecognizer recognizer;
protected CloudSpatialAnchorSession cloudSpatialAnchorSession;
/// <summary>
/// The CloudSpatialAnchor that we either 1) placed and are saving or 2) just located.
/// </summary>
protected CloudSpatialAnchor currentCloudAnchor;
/// <summary>
/// True if we are 1) creating + saving an anchor or 2) looking for an anchor.
/// </summary>
protected bool tapExecuted = false;Initialize Session:
Add methods to handle delegate calls.
Call the InitializeSession() method inside the Start() function:
PreviousHow to update the UI when a callback resolves?NextHow to save the new CloudSpatialAnchor as a WorldAnchor on the local platform?
Last updated
Was this helpful?
