GetAnchorName() public method

public GetAnchorName ( int index ) : XString
index int
return XString
Ejemplo n.º 1
0
        /// <summary>
        /// Kicks off the process of creating the shared space.
        /// </summary>
        private void StartAnchorProcess()
        {
            // First, are there any anchors in this room?
            int anchorCount = currentRoom.GetAnchorCount();

            if (SharingStage.Instance.ShowDetailedLogs)
            {
                Debug.LogFormat("Anchor Manager: {0} anchors found.", anchorCount.ToString());
            }

            if (AnchorDebugText != null)
            {
                AnchorDebugText.text += string.Format("\n{0} anchors found.", anchorCount.ToString());
            }

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

                // Attempt to attach to the anchor in our local anchor store.
                if (AttachToCachedAnchor(storedAnchorName) == false)
                {
                    if (SharingStage.Instance.ShowDetailedLogs)
                    {
                        Debug.Log("Anchor Manager: Starting room anchor download of " + storedAnchorString);
                    }

                    if (AnchorDebugText != null)
                    {
                        AnchorDebugText.text += string.Format("\nStarting room anchor download of " + storedAnchorString);
                    }

                    // If we cannot find the anchor by name, we will need the full data blob.
                    MakeAnchorDataRequest();
                }
            }
#else
            currentState = ImportExportState.AnchorEstablished;

            if (AnchorDebugText != null)
            {
                AnchorDebugText.text += anchorCount > 0 ? "\n" + currentRoom.GetAnchorName(0).ToString() : "\nNo Anchors Found";
            }
#endif
        }
        /// <summary>
        /// Kicks off the process of creating the shared space.
        /// </summary>
        private 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.
                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();
                }
            }
        }