Forum Discussion
pjenness
9 years agoRising Star
Pop up menus examples
Hiya
I need to quickly implement some pop up menus in my app. Is there any good examples available that can be easily modified.
Happy to pay if they are unity store purchases.
What are people using now days.
Cheers
-P
I need to quickly implement some pop up menus in my app. Is there any good examples available that can be easily modified.
Happy to pay if they are unity store purchases.
What are people using now days.
Cheers
-P
14 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffCheck out https://unity3d.com/learn/tutorials/topics/virtual-reality/user-interfaces-vr and https://developer.oculus.com/blog/unitys-ui-system-in-vr. Is that in line with what you're trying to build?
- pjennessRising StarYup, sort of is.. was just wondering if any one had bought an off the shelf robust VR menu system that is easy to slot in own graphics etc.
Ive so much else to work on, if there is a flexible solution that works well I'd pay for it.
Cheers
-P - delphinius81Rising StarYou can just put a Unity canvas with render mode set to world space and then use the rest of Unity's GUI system objects. Drop in new sprites and GUI objects as you normally would. The "trickier" part is handling input, but you can adapt the VRInput and VRInteractiveItem scripts provided by the Unity VR samples project (see the asset store). Didn't take that long to extend those scripts - probably on the order of what it would take to figure out how to use a 3rd party solution anyway.
- pjennessRising Starok kool..will give it go thanks
- pjennessRising StarHi again. So Im back to this. Im really confused by the gui system, in the examples.
They are using a "OVRInspectorLoader", and "OVRInspector" Class. I am assuming they are custom for that demo, and not actual OVR API classes we should use. Its not a bad result but I cant see how they are populating all the information onto the panels, as when I pull them into the Editor ther is no info, jsut the buttons an canvases.
Tried the Crane demo but thats already out of date to its Blog entry. Things like the OVR raycast are not there
To start for now I just want a simple main menu idea, where have submenus like settings,credits, instructions etc. If any one knows of a good simple example, where a button triggers a menu and a few sub menu options, I'd appreciate it.
The rest of my project is moving along ok, just the GUI has me stumped a the moment.And I expect its probably simpler than I think
Cheers heaps
-P - AndyBorrellProtegeFor the crane demo/UI in VR blog post make sure you download the project attached to the blog post (there's a link at the bottom). It's not the same project as the sample framework. I just checked it and it all still seems to be working for me. Which step isn't working for you?
Regarding the OVRInspectorLoader/OVRInspector, the OVRInspector is the only prefab you need to use strictly speaking. The benefit of OVRInspectorLoader is that it makes it easy to have some UI which is present across all scenes and some per-scene UI. If you want to see OVRInspector in action on its own, just load the startup scene in the sample project, remove OVRInspectorLoader from the scene and replace it with the OVRInspector prefab, you should see that the menu still works.
The various top-level menu items in the left panel come from two sources. Some are panels you can see listed under "CenterPanel" in the OVRInspector hierarchy. And some are added programmatically with lines like :recenterButton = leftPanel.AddButton("Recenter", delegate { Recenter(); }, buttonPrefab);which you can see in OVRInspector.UpdateTopMenu() - pjennessRising StarOVRInspector and OVRinspectorLoader are jsut example implementations of menu/ui right. Its not something that is intended to be used?
Ive made a similar one and spawned my own canvas based menu.
Its using unity UI with buttons etc.
If I use the VRInput and VRInteractiveItem from the VR samples that should work right?
Are people using Unity Buttons for example, adding VRInteractiveItem and then calling the buttons own functions on the "onClick" event etc. So instead of a mouse over click it is runs the VRinput onClick?
Is that the right approach?
Cheers
-P - delphinius81Rising StarI do exactly that for my buttons (VRInteractiveItem on 3D objects in the scene), while using Unity UI worldspace canvas for things like text and images.
- pjennessRising StarHiya @delphinius81
Im still stuck. I cant believe how this of all things is getting me stumped.
Are you:- still using the unity "Button" UI component to store the onClick function call? Or using your own function call system
- Adding VRinteractive as a component or as an inheritance (to use its on events)
- Adding the VR Eye Raycaster and VRinput to center cam or using your own setup? I feel like these dont really work well with OVRinput.
I cant work out how to use the VR interactive on event system , unless perhaps I inherit my buttons from it and override the onOver onClick etc?
if I use as component it looks like this:public VRInteractiveItem m_VRinteractiveItem = null;void Awake ()
{
if (!m_VRinteractiveItem) {
m_VRinteractiveItem = (VRInteractiveItem)GetComponent (typeof(VRInteractiveItem));
}
}
But then how do and where would I check for the onOver or
OnClick
event for m_VRinteractiveItem
some how Im guessing I need to listen for or use
m_VRinteractiveItem.OnClick ??
Im puzzled how these all chain together
What does yours look like?
Is is somthine like this in start:m_VRinteractiveItem.OnClick += doClick;
where doClick () is my own additional commands for my button?
does += on an event add to what happens for that event? and -= remove it?
Thanks heaps
-P - still using the unity "Button" UI component to store the onClick function call? Or using your own function call system
- pjennessRising Star
AHA I think I got it...
Inside my buttons onEnable():m_VRinteractiveItem.OnOver += doOver;
Also had to add collider to the button
Woohoo!!
-P
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 4 months ago