/// <summary>
        /// Stop the session and cleanup any anchors created.
        /// </summary>
        private void StopAndCleanupSession()
        {
            // Clean up the sample scenario, destroying any anchors
            foreach (GameObject gameObject in m_foundOrCreatedAnchorObjects)
            {
                Destroy(gameObject);
            }
            m_foundOrCreatedAnchorObjects.Clear();

            // Stop the session
            if (!m_cloudSpatialAnchorManager.IsSessionStarted)
            {
                Debug.LogWarning("Cannot stop session; session has not started.");
                return;
            }

            Debug.Log("Stopping session...");
            m_cloudSpatialAnchorManager.StopSession();
            m_cloudSpatialAnchorManager.Session.Reset();

            // Stop the watcher, if it exists
            if (m_cloudSpatialAnchorWatcher != null)
            {
                m_cloudSpatialAnchorWatcher.Stop();
                m_cloudSpatialAnchorWatcher = null;
            }
            Debug.Log("Session stopped!");
        }
        private async void StopAzureSession()
        {
            // Reset the current session if there is one, and wait for any active queries to be stopped
            await cloudManager.ResetSessionAsync();

            // Stop any existing session
            cloudManager.StopSession();
        }
Esempio n. 3
0
    public void OnDestroy()
    {
        Log($"{nameof(OnDestroy)} Stopping ASA Controller");

        if (CloudManager != null)
        {
            CloudManager.StopSession();
        }
    }
Esempio n. 4
0
    async public Task ResetSession()
    {
        foreach (ARAnchor anchor in aRAnchorManager.trackables)
        {
            aRAnchorManager.RemoveAnchor(anchor);
            Debug.Log("trying to remove anchor: " + anchor.trackableId);
        }
        currentCloudAnchor  = null;
        previousCloudAnchor = null;
        foundAnchors.Clear();
        spatialAnchorManager.StopSession();
        await spatialAnchorManager.ResetSessionAsync();

        await spatialAnchorManager.StartSessionAsync();
    }
Esempio n. 5
0
    private async void StopAzureSession()
    {
        Debug.Log("\nAnchorModuleScript.StopAzureSession()");
        // Notify AnchorFeedbackScript
        OnEndASASession?.Invoke();

        Debug.Log("Stopping Azure session... please wait...");

        // Stops any existing session
        cloudManager.StopSession();

        // Resets the current session if there is one, and waits for any active queries to be stopped
        await cloudManager.ResetSessionAsync();

        Debug.Log("Azure session stopped successfully");
    }
Esempio n. 6
0
        private async Task StopSession()
        {
            Task tempStartTask = null;

            lock (sessionStartLock)
            {
                if (sessionStartTask != null)
                {
                    tempStartTask = sessionStartTask;
                }
            }

            if (tempStartTask != null)
            {
                await Task.WhenAll(tempStartTask);
            }

            spatialAnchorManager.StopSession();
        }
Esempio n. 7
0
        /// <summary>
        ///     Azure Spatial Anchorsサービスとの接続を停止します。
        /// </summary>
        /// <returns></returns>
        public async Task StopAzureSession()
        {
            try
            {
                Debug.Log("\nAnchorModuleScript.StopAzureSession()");

                OutputLog("Stopping Azure session... please wait...");

                // Stops any existing session
                cloudManager.StopSession();

                // Resets the current session if there is one, and waits for any active queries to be stopped
                await cloudManager.ResetSessionAsync();

                OutputLog("Azure session stopped successfully", isOverWrite: true);
            }
            catch (Exception e)
            {
                Debug.Log(e);
                throw;
            }
        }
Esempio n. 8
0
    public async Task StopAzureSessionAsync()
    {
        if (!this.SessionStarted)
        {
            return;
        }

        Debug.Log("\nAnchorModuleScript.StopAzureSession()");

        // Notify AnchorFeedbackScript
        OnEndASASession?.Invoke();

        Debug.Log("Stopping Azure session... please wait...");

        // Stops any existing session
        cloudManager.StopSession();

        // Resets the current session if there is one, and waits for any active queries to be stopped
        await cloudManager.ResetSessionAsync();

        this.SessionStarted = false;

        Debug.Log("Azure session stopped successfully");
    }
Esempio n. 9
0
    public async Task ResetSession()
    {
        foreach (ARAnchor anchor in aRAnchorManager.trackables)
        {
            if (anchor == null)
            {
                break;
            }
            Log.debug($"-----ARFoundation removing {anchor.trackableId}");
            aRAnchorManager.RemoveAnchor(anchor);
            Log.debug("-----ARFoundation removed anchor ");
        }
        anchorManager.ClearCloudSpatialAnchorList();
        Log.debug($"-----SpatialAnchorManager Session is about to Reset:{anchorFirstTimeFound}");
        spatialAnchorManager.StopSession();
        await spatialAnchorManager.ResetSessionAsync();

        ConfigureSensors();
        await spatialAnchorManager.StartSessionAsync();

        Log.debug($"-----SpatialAnchorManager Reset Complete:{anchorFirstTimeFound}");
        Log.debug("Reset Anchor Lerper");
        FindObjectOfType <AnchorLerper>().ResetLerper();
    }