Search Unity

uPI(e) Menu - Radial Menu

Discussion in 'Assets and Asset Store' started by Yearn, Apr 22, 2015.

  1. Kade514

    Kade514

    Joined:
    Sep 7, 2014
    Posts:
    12
    I think I forgot to mention that they're worldspace UI items for a VR game I''m making. There are event triggers on each button so I'll try to recreate the system that you've used in your ping demo menu and see what happens. :)

    Edit: When I remove the event triggers on the buttons in the editor they get re-added to the buttons when the game starts. It's an odd issue and doesn't occur in your other scenes.

    Edit 2: I've noticed in the ping demo menu that setting it to use the gamepad gives you the option to change the deadzone of the controller whereas my version of the menu does not. Is it possible that this is the cause of the issue?
     
    Last edited: Jun 3, 2016
  2. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi Kade514,

    this sounds like you are using an outdated version. I kicked these EventTriggers out a few versions ago.
    Using the most recent version is always recommended. Probably updating to the newest version already fixes your issue.
     
  3. Kade514

    Kade514

    Joined:
    Sep 7, 2014
    Posts:
    12
    I'll give it a go and let you know what happens.
     
  4. ThinqbotTech

    ThinqbotTech

    Joined:
    May 12, 2016
    Posts:
    5
    Hey Yearn,

    I have been using the uPIe system to implement a cornered quarter menu in my mobile application. I wanted to create the menu procedurally, so I am opting for entirely scripted generator. Now for some options, my submenu contains more than 10 items, which I wanted to scroll through for that particular submenu. I thought of updating the offset on touch move to achieve kind of a ring scroll effect.
    I tried changing the startDegOffset value at runtime, but the submenu doesn't respond to that. I went through the documentation for the uPIeMenu class, but there isn't a public method that I can use to refresh the menu so that the change in startDegOffset will be reflected at run time. Can you point me in a direction as to how this can be implemented? Thanks!
     
  5. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi ThinqbotTech,
    the value set up in "StartDegOffset" controls what part of the menu comes first and which part is to select. So this value is used for internal calculations and is not reflected visually by rotating the menu automatically.
    However you could use the method "Realign()" (or one of it's overloads) after chaning the "StartDegOffset" value: link to the documentation.
    If realign does not do what you are looking for (maybe the menu options should not be placed perfectly circular, so this could mess up your alignment) you could just rotate the uPie's RectTransform. But for that approach you need to make sure the "StartDegOffset" value is set appropriately fitting to the current rotation - else your selections might be off, because uPie assumes the menu's up direction to be aligned with the Y axis.
     
  6. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    65
    Hello,

    First, we like very much uPieMenu.
    Second, since our upgrade from Unity 4.6 to 5.40f3 under Macos Yosemite, we got this error now in the Editor:
    "MissingFieldException: Field 'UnityEngine.EventSystems.EventTrigger.triggers' not found.
    uPIeMenu.CreateCallbacks ()
    uPIeMenu.Awake ()"


    Our piemenu seems to work normally anyway..
     
  7. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi,
    is this issue persistent, or does the error disappear, when clicking clear in the console? If it does disappear there is nothing to worry about, if not, reimporting the plugin from the asset store should fix the issue. Are you using the latest version of uPIe?
     
    Last edited: Aug 28, 2016
  8. tmr_public

    tmr_public

    Joined:
    Oct 6, 2016
    Posts:
    1
    hi

    I bought this good asset ! (version 1.3)
    please help me about it !

    I want to add customized menu options programmatically.
    I set prefab to "menu option prefab" on inspector view, and I run the code below on my script.

    ```
    GetComponent<uPIeMenu>().AddMenuOptionAndRescaleY();
    ```

    but It was instantiated default menu option.
    I expect to instantiate customized menu option.
    why?

    thank you.
     
  9. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi tmr_public,
    I just looked into this behaviour - this is my bad. The menu tries to fall back to the last menu option, without even trying to instantiate the prefab. I just fixed it and I'm updating the asset in the asset store - but it might take a while (about one to two weeks) until the new version is available via the asset store.
    In the meantime you could set your last menu option to the instantiated version of your prefab as a work around. If you want to have different buttons you could reset it afterwards. In the meantime you could do something like that:

    var menu = Target.GetComponent<uPIeMenu>();
    var lastOptionBuffer = menu.MenuOptions[menu.MenuOptions.Count - 1];
    var tempPrefabInstance = Instantiate(menu.MenuOptionPrefab);
    menu.MenuOptions[menu.MenuOptions.Count - 1] = tempPrefabInstance.GetComponent<Selectable>();
    menu.AddMenuOptionAndRescaleY();
    menu.MenuOptions[menu.MenuOptions.Count - 2] = lastOptionBuffer;
    lastOptionBuffer.transform.position = tempPrefabInstance.transform.position;
    lastOptionBuffer.transform.rotation = tempPrefabInstance.transform.rotation;
    lastOptionBuffer.transform.localScale = tempPrefabInstance.transform.localScale;
    Destroy(tempPrefabInstance);

    Edit: Fixed in version 1.3.1
     
    Last edited: Oct 20, 2016
  10. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    957
    I just picked this up, looks great!

    I have one problem though. I'm using your Ping Menu, along with Play Maker's 'Play Maker U Gui Component Proxy' and I can't get it to work. When I highlight over the RadialMenuOptionButton# and un-click, your Ping Menu Demo script fires off, but the PM Component Proxy doesn't. The Proxy works since I can assign it to a standard Unity UI > Button component and get the functionality working like in the link I provided. I'm running 5.5.0b11 if that matters. Have any thoughts or suggestions?

    Thanks.
     
  11. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi adamz,

    sorry for the late reply I'm pretty busy at the moment. I just wanted to let you know I noticed your post and I'm looking into it as soon as possible
     
  12. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    957
    I appreciate it.
     
  13. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi adamz, I'm finally back :)

    I guess I found out what issue you are facing. I guess the PlayMaker events do not trigger for you, because the state machine is attached to the ping-menu-button. At least this is how it is shown in the video you posted - so if you followed this video I'm pretty sure this is the issue.
    The problem is for the ping menu the button-gameobject gets deactivated as soon as you release your mouse button (or gamepad or whatever you use). So the PlayMaker FSM never has a chance to execute, because it is immediately deactivated. One solution for this would be to create seperate gameobjects which contain the state machines for each button instead of adding the PlayMakerFSM component directly to the menu-button-gameobject.
    So you could set up your "PlayMakerUGuiComponentProxy" component instead of "Target - Owner" (which is default) to "Target - GameObject" and link the related FSM-gameobject. I included screenshots for better illustration. Hope this helps, if not don't hesitate to ask :)
     

    Attached Files:

    Last edited: Feb 26, 2017
  14. mabakay

    mabakay

    Joined:
    Jun 10, 2016
    Posts:
    19
    Could you fix your webgl demo link?
     
  15. Rogerio-Castro

    Rogerio-Castro

    Joined:
    Mar 18, 2014
    Posts:
    3
    Is this still working with unity Unity 2017.2.0b8 ?
     
  16. mabakay

    mabakay

    Joined:
    Jun 10, 2016
    Posts:
    19
    Uhm... No response, I buy other asset.
     
  17. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi I'm sorry for the late response, somehow I don't get notified about new posts anymore...
    I changed the server and updated the links in the description. For as long as the package description is not updated in the asset store here are the links to the WebDemo and to the Online-Documentation
    I tried the asset with unity version 2017.1.1f1 and it works fine, I'm checking the latest beta and let you know :)

    EDIT: I just tried Unity 2017.2.0b11 and it works fine
     
    Last edited: Sep 23, 2017
  18. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    65
    Hello,
    How can I convert each button of the piemenu as a togglebutton ?
    I want to click on a button, close the piemenu, reopen, and voila, the button has kept the same status,
    Thanks
     
  19. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi,
    you should be able to just use a Toggle instead of a Button - uPIe does not change the state of the menu option.
    To do so you could create your toggle as you like, create a Prefab from it and assign the prefab to "Menu Option Prefab".
    Then just click "Add New Menu Option". A new toggle button should get created and linked in the appropriate Menu Option field. If the menu option is set to "None" you might need to link it manuall (via drag and drop). I guess the latest unity version has some trouble automatically linking the prefab instances. I'm looking into it

    EDIT: you're right - uPIe only looks for a "Button" script attached to the prefab / menu option. For Toggles there is no such script. So this is a feature I might implement in the next version. For now you need to link Toggles manually. But besides not getting linked as menu option automatically your desired behaviour should work when you link your toggles manually
     
    Last edited: May 29, 2019
  20. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    65
    Thanks for your reply, we'll test it.
     
  21. kalantor0

    kalantor0

    Joined:
    Oct 21, 2018
    Posts:
    1
    Hello,

    I am trying to create a sub-menu by adding the uPi Script to a menu button. But the submenu created in this way is visible all the time. In your submenu example scene, they submenu is only shown when the parent menu button is clicked. I have checked and tried to keep the same structure as your example submenu, but I can't get this to work. In your scene, the submenu is disabled until I click on the parent menu button. I couldn't understand how you are doing that. Disabling the parent menu button makes the whole submenu and parent button vanish.

    Thanks in advance.
     

    Attached Files:

  22. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi unity_byCcnKw0IrONwg,

    sorry for the late response. The main logic behind these sub-menus is following:
    1. create a new uPieMenu and wire up sub-buttons in there
    2. deactivate the sub-menu
    3. set up an on-click event for `OpenSubMenu` on a button on the parent-menu
    4. set up an on-click event for `ReturnToSuperMenu` on a button on the sub-menu
    On your screenshot it looks like the catch for you is at step 2: It looks like the sub-menu is enabled. To disable the gameobject which contains the sub-menu click the checkbox next to the gameobject-name `RadialMenuOptionButton#6` (in the inspector on the right - see here: https://docs.unity3d.com/uploads/Main/GOActiveBox.png). Then the object should be greyed out like the other sub-menus `uPiMenu SubMenu lvl 1` and uPiMenu SubMenu 2 lvl 1

    Also, it looks like you try to add the sub-menu directly on the button that activates the sub-menu. I recommend not to do so, but create a seperate new gameobject for the new submenu. Because else you could not disable the sub-menu without disabling the button for instance.
     
    Last edited: Sep 7, 2019
  23. alkohol

    alkohol

    Joined:
    Aug 16, 2017
    Posts:
    3
    Hi @Yearn

    I run into one issue while trying to implement custom input. And the issue was that upieMenu component is looking for canvas on root object, but in my hierarchy canvas is placed deeper - not on root object. Moving canvas to the top solved the issue, however it'll be better to have possibility to set used canvas through API than change the scene hierarchy.
    So question is - is it possible to update API with new method? Thanks in advance.
     
    Last edited: Sep 17, 2019
  24. alkohol

    alkohol

    Joined:
    Aug 16, 2017
    Posts:
    3
    One more sad thing. uPieMenuEventTrigger isn't working with custom input. It works when I use mouse and just hovering/selecting selectables with mouse. But I can't catch select/deselect event, when this is done with custom input - upieMenu simply doesn't fire any events.
     
  25. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi, generally I would not really recommend nesting the canvas in other gameobjects due to potential transformation/scaling issues. I'll think about exposing an option to link the canvas element, but I also try to keep the amount of options visually shown in the inspector window as low as possible to make the whole system more accessible.

    The scene 'Demo Custom Input' hast two example scripts - one for custom pointer-like input (like a custom mouse) and one for custom gamepad-like inputs. When adding some actions to the OnClick events on the buttons in this scene they get executed for both custom inputs. This is also working for select/deselect events (just checked in Unity 2019.3.0a3). Just add an EventTrigger component (the default unity component - not uPieMenuEventTrigger) and it should work
     
  26. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi again!

    I just wanted to let you know, that the feature you requested will be in the next uPIe release! I just submitted both, the DLL and the PRO packages for review. As soon as it is approved by Unity it will be available via the asset store. Usually this process takes about 1 - 2 weeks.
    Thanks for your input and sorry it took me so long. I just didn't find the time to work on the project in the past months.

    Did using non-uPIeMenuEventTriggers help with the select/deselect events you pointed out?
     
  27. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    957
    This looks great. Would it be pretty easy to implement for VR? I'd like to be able to have the menu displayed using the Oculus Quest controller when touching the thumb-stick, and then having the thumb-stick drive the radial menu.

    Thanks.
     
  28. Yearn

    Yearn

    Joined:
    Apr 22, 2015
    Posts:
    36
    Hi adamz,

    when using the controller to navigate the menu there should not be a difference whether you use a VR System or just a regular display with a regular controller. So as I understand the question, yes this will be easy :)
    You could also use uPIe to control a menu by look-direction. The package contains an example for that use-case. I will also update the webdemo to demonstrate this in the near future (probably today)

    Have a nice day!

    Edit: I just updated the webdemo
     
    Last edited: Jan 25, 2020
unityunity