I’m fairly new to developing on the Oculus and completely so in the latest update of Unity, and as such, I don’t know if what I’m seeking is feasible or not without resorting to more complex measures than what is available out of the box.
My primary concern being the ability to enable/disable the Oculus at will during runtime. In the most likely of scenarios, starting up a scene without the Oculus turned on, and then turning it on as the scene progresses. Essentially supporting VR in the project regardless of whether a device was connected at the start or not.
In the long run I want to be able to catch the event when a device is connected/disconnected and give the player the option to enable VR if a device is present. And similarly, revert back to the basic view if a device is removed.
I’ve been testing the new VRDevice class available in the Unity.VR namespace, most notably the isPresent property, and so far it has turned up mixed results.
If I run the scene with the Oculus turned off, VR, from the looks of the console seems to be excluded from the build, and from that point on, turning on the Oculus does nothing. isPresent contains false in all cases.
However, if I keep the device turned on and run the scene, the device is detected normally. And from that point on, I can disconnect/reconnect it and the scene is displayed in the device regardless. Although isPresent contains true always, which I find a bit odd. I would expect it to revert back to false after disconnecting the device.
Although I’m still not entirely sure what I’m asking about. My question is, is there a general way to approach management of the Oculus during runtime that’s so far been used in the old Oculus plugin and could be applied to Unity 5.1 as well?
PS: If something about this post comes off as particularly vague, do feel free to ask and I’ll try my best to elaborate.