Exemplo n.º 1
0
        public void DisableSession()
        {
            if (SessionState != SessionState.Running)
            {
                return;
            }
            SessionState = SessionState.Paused;

            if (NRVirtualDisplayer.RunInBackground)
            {
                NRRenderer?.Pause();
                NativeAPI.NativeTracking?.Pause();
                VirtualDisplayer?.Pause();
                NRDevice.Instance.PauseGlassesController();
                NRDevice.Instance.PauseHMD();
            }
            else
            {
                NRDevice.ForceKill();
            }
        }
Exemplo n.º 2
0
        public void DisableSession()
        {
            if (SessionState != SessionState.Running)
            {
                return;
            }

            // Do not put it in other thread...
            if (NRVirtualDisplayer.RunInBackground)
            {
                NRRenderer?.Pause();
                NativeAPI.NativeTracking?.Pause();
                VirtualDisplayer?.Pause();
                NRDevice.Instance.Pause();
                SessionState = SessionState.Paused;
            }
            else
            {
                NRDevice.ForceKill();
            }
        }
Exemplo n.º 3
0
        private void OnApplicationPause(bool pause)
        {
            // If NRSessionBehaviour is exist, do not oprate.
            if (NRSessionManager.Instance.NRSessionBehaviour != null)
            {
                return;
            }

            if (pause)
            {
                if (RunInBackground)
                {
                    this.Pause();
                }
                else
                {
                    NRDevice.ForceKill();
                }
            }
            else
            {
                this.Resume();
            }
        }