/// <summary>
/// Called when a remote anchor has been deserialized
/// </summary>
/// <param name="status">Tracks if the import worked</param>
/// <param name="wat">The WorldAnchorTransferBatch that has the anchor information.</param>
private void ImportComplete(SerializationCompletionReason status, WorldAnchorTransferBatch wat)
{
if (status == SerializationCompletionReason.Succeeded && wat.GetAllIds().Length > 0)
{
Debug.Log("Import complete");
string first = wat.GetAllIds()[0];
Debug.Log("Anchor name: " + first);
WorldAnchor existingAnchor = objectToAnchor.GetComponent<WorldAnchor>();
if (existingAnchor != null)
{
DestroyImmediate(existingAnchor);
}
WorldAnchor anchor = wat.LockObject(first, objectToAnchor);
WorldAnchorManager.Instance.AnchorStore.Save(first, anchor);
ImportInProgress = false;
AnchorEstablished = true;
}
else
{
// if we failed, we can simply try again.
gotOne = true;
Debug.Log("Import fail");
}
}