Наследование: global::System.IDisposable
        /// <summary>
        /// Called when anchor download operations complete.
        /// </summary>
        private void RoomManagerListener_AnchorDownloaded(bool successful, AnchorDownloadRequest request, XString failureReason)
        {
            // If we downloaded anchor data successfully we should import the data.
            if (successful)
            {
                int dataSize = request.GetDataSize();

                if (ShowDetailedLogs)
                {
                    Debug.LogFormat("[SharingWorldAnchorManager] Downloaded {0} bytes.", dataSize.ToString());
                }

                if (AnchorDebugText != null)
                {
                    AnchorDebugText.text += string.Format("\nDownloaded {0} bytes.", dataSize.ToString());
                }

                rawAnchorDownloadData = new byte[dataSize];
                request.GetData(rawAnchorDownloadData, dataSize);
                shouldImportAnchors = true;
            }
            else
            {
                Debug.LogWarning("[SharingWorldAnchorManager] Anchor DL failed " + failureReason);
                if (AnchorDebugText != null)
                {
                    AnchorDebugText.text += string.Format("\nAnchor DL failed " + failureReason);
                }
            }
        }
        /// <summary>
        /// Called when anchor download operations complete.
        /// </summary>
        private void RoomManagerCallbacks_AnchorsDownloaded(bool successful, AnchorDownloadRequest request, 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();
            }
        }
Пример #3
0
        /// <summary>
        /// Called when anchor download operations complete.
        /// </summary>
        private void RoomManagerListener_AnchorsDownloaded(bool successful, AnchorDownloadRequest request, XString failureReason)
        {
            // If we downloaded anchor data successfully we should import the data.
            if (successful)
            {
                int datasize = request.GetDataSize();

                if (SharingStage.Instance.ShowDetailedLogs)
                {
                    Debug.LogFormat("Anchor Manager: Anchor size: {0} bytes.", datasize.ToString());
                }

                if (AnchorDebugText != null)
                {
                    AnchorDebugText.text += string.Format("\nAnchor size: {0} bytes.", datasize.ToString());
                }

                rawAnchorData = new byte[datasize];

                request.GetData(rawAnchorData, datasize);
                currentState = ImportExportState.DataReady;
            }
            else
            {
                if (AnchorDebugText != null)
                {
                    AnchorDebugText.text += string.Format("\nAnchor DL failed " + failureReason);
                }

                // If we failed, we can ask for the data again.
                Debug.LogWarning("Anchor Manager: Anchor DL failed " + failureReason);
#if UNITY_WSA && !UNITY_EDITOR
                MakeAnchorDataRequest();
#endif
            }

            if (AnchorDownloaded != null)
            {
                AnchorDownloaded(successful);
            }
        }