void Awake () { if(OVRManager.capiHmd == null) { OVR_Initialize(); } IntPtr hmdPtr = IntPtr.Zero; OVR_GetHMD(ref hmdPtr); ovrHmd = (hmdPtr != IntPtr.Zero) ? new Hmd(hmdPtr) : null; }
private void OnDisable() { #if !UNITY_ANDROID || UNITY_EDITOR if (!isQuitting) return; if (ovrIsInitialized) { OVR_Destroy(); OVRPluginEvent.Issue(RenderEventType.Destroy); _capiHmd = null; ovrIsInitialized = false; } #else // NOTE: The coroutines will also be stopped when the object is destroyed. StopAllCoroutines(); #endif }
private void OnDisable() { if (!isQuitting) return; if (ovrIsInitialized) { OVR_Destroy(); OVRPluginEvent.Issue(RenderEventType.Destroy); _capiHmd = null; ovrIsInitialized = false; } }
private void OnDisable() { #if !UNITY_ANDROID || UNITY_EDITOR if (!isQuitting) return; if (ovrIsInitialized) { OVR_Destroy(); OVRPluginEvent.Issue(RenderEventType.Destroy); _capiHmd = null; ovrIsInitialized = false; } #else StopAllCoroutines(); #endif }