public void DestroySession() { if (!m_IsInitialized && m_IsDestroyed) { return; } m_IsDestroyed = true; #if !UNITY_EDITOR_OSX NativeAPI.NativeHeadTracking.Destroy(); NativeAPI.NativeTracking.Destroy(); if (VirtualDisplayer != null) { VirtualDisplayer.Destory(); } if (RenderController != null) { RenderController.Destroy(); } NRDevice.Instance.Destroy(); #endif if (GameObject.FindObjectOfType <NRKernalUpdater>() != null) { NRKernalUpdater.Instance.OnUpdate -= NRFrame.OnUpdate; } m_IsInitialized = false; }
public void DestroySession() { if (SessionState == SessionState.Destroyed || SessionState == SessionState.UnInitialized) { return; } SessionState = SessionState.Destroyed; NRRenderer?.Destroy(); NativeAPI.NativeHeadTracking.Destroy(); NativeAPI.NativeTracking.Destroy(); VirtualDisplayer?.Destory(); NRDevice.Instance.Destroy(); FrameCaptureContextFactory.DisposeAllContext(); }
public void DestroySession() { if (!m_IsInitialized && m_IsDestroyed) { return; } m_IsDestroyed = true; NativeAPI.NativeHeadTracking.Destroy(); NativeAPI.NativeTracking.Destroy(); VirtualDisplayer?.Destory(); NRRenderer?.Destroy(); NRDevice.Instance.Destroy(); FrameCaptureContextFactory.DisposeAllContext(); m_IsInitialized = false; }