Regaining VR Focus After DeviceLost/Acquired In Unity
Hi, is there a way to programatically set VR focus back to our application? Currently when a device is lost (i.e. user unplugs cable) and is acquired again (i.e. user plugs the cable back in), Oculus Dash is displayed and I can switch back to the application using a controller. The application correctly handles recycling of the device and everything is running as expected. The issue is that normally user does not have a controller available (the application is an arena-scale LBVR experience, tracked by Optitrack) and the only way to get rid of the Dash is to restart the whole application, which is obviously problematic. The application runs on Unity 2018.1.1 and the latest Oculus plugin/SDK. I'm aware of the Unity-related Dash and focus resources https://developer.oculus.com/documentation/unity/latest/concepts/unity-dash/ https://developer.oculus.com/documentation/unity/latest/concepts/unity-lifecycle/ however they describe how to detect and adjust to when a focus is lost, rather than how to completely recover from it and resume playing. According to the documentation, this should be possible in the native library (https://developer.oculus.com/documentation/pcsdk/latest/concepts/dg-vr-focus/), however the managed API in Unity (OVRPlugin and OVRManager) is somewhat limited and doesn't seem to contain any way of completely reinitializing the device and/or setting focus back to my application. Is there a way how to do it in Unity? Perhaps writing a native plugin? Thanks, Martin1.2KViews0likes1CommentVRFocusLost / Acquired is not being called on builds
I'm trying to utilize OVRManager.VrFocusAcquired and OVRManager.VrFocusLost to tell a UI Canvas in Screen Space (which is only visible on the monitor) to show "nothing" (if the headset is on) or instructions on how to put the headset on (if the headset is off). This _works_ in the editor. I see on-screen text indicating the change in status, and if I press a key my local boolean "hasVRFocus" (which is set in the delegates) reports correctly. It does _not_ work in a build. My delegates are not being called. I get no on-screen text updates from those methods (while others work fine), and "hasVRFocus" always reports its initial value. This is with Unity 5.4.0p2 and Oculus 1.6 on Windows 8.1, using a CV1, in a custom project created solely to test this feature. Looking for assistance!802Views0likes1Comment