Reputation: 113
I'm creating an application that has optional VR support, I started out by just detecting if there's an HMD detected, and if so enabling the needed buttons to the menu.
Then I ran into a problem, when the app is launched through the direct-to-rift mode its only possible to use the Oculus camera rig. The default Unity camera just shows a blue screen, this means I can't use any of the main application in this mode.
This led me to create a simple VR menu to start the VR part that only shows when direct mode is used.
I did this by using
OVRManager.display.isDirectMode
OVRManager.display.isPresent
this works fine when direct or extended mode is used, or when the rift is not connected at all. But when the rift is connected in direct mode and the application is started with the default executable(not the direct-to-rift one). It still detects the Rift and that it's in direct mode but I couldn't find a way to check if the HMD is actually on which means the VR menu is activated when it shouldn't be.
Is there a way to see if Unity is actually using the rift or if the display is on?
Are there any other methods to launch to the rift when the application is already running?
Is there a way to see what executable was used to start the application?
Upvotes: 2
Views: 585
Reputation: 132
Can't guarantee it will work for unity, but you should be able to call:
System.Environment.GetCommandLineArgs()
and get the executable name from the first argument in order to see what the starting executable was.
https://msdn.microsoft.com/en-us/library/system.environment.getcommandlineargs.aspx
Upvotes: 1