Assets/Scripts/ImportExportAnchorManager.cs
/// <summary>
/// Exports the currently created anchor.
/// </summary>
Exports the currently created anchor.
Exports the currently created anchor .
void Export()
    {
        WorldAnchor anchor = GetComponent<WorldAnchor>();
        if (anchor == null)
        {
            Debug.Log("We should have made an anchor by now...");
            return;
        }
        string guidString = Guid.NewGuid().ToString();
        exportingAnchorName = guidString;
        if (anchorStore.Save(exportingAnchorName, anchor))
        {
            sharedAnchorInterface = new WorldAnchorTransferBatch();
            sharedAnchorInterface.AddWorldAnchor(guidString, anchor);
            WorldAnchorTransferBatch.ExportAsync(sharedAnchorInterface, WriteBuffer, ExportComplete);
        }
        else
        {
            Debug.Log("This anchor didn't work, trying again");
            CurrentState = ImportExportState.InitialAnchorRequired;
        }
    }
void Export ( ) { WorldAnchor anchor = GetComponent < WorldAnchor > ( ) ; if ( anchor == null ) { Debug . Log ( " " ) ; return ; } string guidString = Guid . NewGuid ( ) . ToString ( ) ; exportingAnchorName = guidString ; if ( anchorStore . Save ( exportingAnchorName , anchor ) ) { sharedAnchorInterface = new WorldAnchorTransferBatch ( ) ; sharedAnchorInterface . AddWorldAnchor ( guidString , anchor ) ; WorldAnchorTransferBatch . ExportAsync ( sharedAnchorInterface , WriteBuffer , ExportComplete ) ; } else { Debug . Log ( " " ) ; CurrentState = ImportExportState . InitialAnchorRequired ; } }
Exports the currently created anchor.
Exports the currently created anchor .
// Save the anchor to our local anchor store.