r/oculusdev • • Apr 06 '16

How to implement GearVR universal menu with sdk 1.0 and greater

I haven't been able to find great resources online as to how to implement the GearVR's universal menu in unity...

The oculus guidelines say that the universal menu must be activated with a longpress of the back button, and the "back to oculus home" menu must be activated with a short press of the back button.

Has anyone here implemented these features on their gearVR app? Could you explain how you did?

6 Upvotes

9 comments sorted by

4

u/delphinius81 Apr 06 '16

Take a look at the OVRPlatformMenu script that's part of the Oculus Unity tools (OVR/Moonlight/Scripts/OVRPlatformMenu.cs). Attach that script to an object that will persist throughout your game.

2

u/[deleted] Apr 06 '16

Thank you! That did the trick

2

u/delphinius81 Apr 06 '16

Glad that helped! I never got the timer circle to display properly, but it at least takes care of the short/long press requirements for you.

2

u/[deleted] Apr 06 '16

Haha I was just about to ask you about that... I dragged the "Cursor_Timer" Gameobject into the Cursor Timer slot in the inspector, but it seems to disable the long-press to Univeral Menu feature...weird

2

u/delphinius81 Apr 06 '16

Yeah I have no idea why it doesn't work. I was able to build/run the sample scene and it worked just fine. So there must be something we're missing...

1

u/[deleted] May 06 '16

I was exploring the Oculus SDK and realized that you can display the Cursor_Timer material during a long-press by assigning the tag "MainCamera" to your main camera.

Hope that works for you!

1

u/delphinius81 May 06 '16

Thanks for the info! I found that in my case there were a number of texture import and material settings that were different. Once I fixed the differences, the timer animation worked properly.

1

u/Gruguir May 18 '16

Ok i also found that this works by attaching OVRPlatformMenu.cs. But how to bypass it to be able to use back button (like for game's own menu or return to app's start screen) ? Is there an elegant way or do we have to modify OVRPlatformMenu.cs ?

1

u/[deleted] May 19 '16

I forget the fine details of this, but you will have to modify/interact with the Oculus SDK.

Read through OVRPlatform.cs and any other classes that might be involved to get a better understanding of how the software works. You shouldn't have too much trouble solving this once you have.