Ejemplo n.º 1
0
 /// <summary>
 /// Called when anchor upload operations complete.
 /// </summary>
 private void RoomManagerCallbacks_AnchorUploaded(bool successful, HoloToolkit.Sharing.XString failureReason)
 {
     if (successful)
     {
         CurrentState = ImportExportState.Ready;
     }
     else
     {
         Debug.Log("Upload failed " + failureReason);
         CurrentState = ImportExportState.Failed;
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Kicks off the process of creating the shared space.
    /// </summary>
    void StartAnchorProcess()
    {
        // First, are there any anchors in this room?
        int anchorCount = currentRoom.GetAnchorCount();

        Debug.Log(anchorCount + " anchors");

        // If there are anchors, we should attach to the first one.
        if (anchorCount > 0)
        {
            // Extract the name of the anchor.
            HoloToolkit.Sharing.XString storedAnchorString = currentRoom.GetAnchorName(0);
            string storedAnchorName = storedAnchorString.GetString();

            // Attempt to attach to the anchor in our local anchor store.
            if (AttachToCachedAnchor(storedAnchorName) == false)
            {
                Debug.Log("Starting room download");
                // If we cannot find the anchor by name, we will need the full data blob.
                MakeAnchorDataRequest();
            }
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Called when anchor download operations complete.
    /// </summary>
    private void RoomManagerCallbacks_AnchorsDownloaded(bool successful, HoloToolkit.Sharing.AnchorDownloadRequest request, HoloToolkit.Sharing.XString failureReason)
    {
        // If we downloaded anchor data successfully we should import the data.
        if (successful)
        {
            int datasize = request.GetDataSize();
            Debug.Log(datasize + " bytes ");
            rawAnchorData = new byte[datasize];

            request.GetData(rawAnchorData, datasize);
            CurrentState = ImportExportState.DataReady;
        }
        else
        {
            // If we failed, we can ask for the data again.
            Debug.Log("Anchor DL failed " + failureReason);
            MakeAnchorDataRequest();
        }
    }