/// <summary>
/// If we are supposed to create the anchor for export, this is the function to call.
/// </summary>
public void CreateAnchor()
{
objectToAnchor = SharedCollection.Instance.gameObject;
WorldAnchorTransferBatch watb = new WorldAnchorTransferBatch();
WorldAnchor worldAnchor = objectToAnchor.GetComponent<WorldAnchor>();
if (worldAnchor == null)
{
worldAnchor = objectToAnchor.AddComponent<WorldAnchor>();
}
exportingAnchorName = Guid.NewGuid().ToString();
Debug.Log("exporting " + exportingAnchorName);
watb.AddWorldAnchor(exportingAnchorName, worldAnchor);
WorldAnchorTransferBatch.ExportAsync(watb, WriteBuffer, ExportComplete);
}