Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

MenuItem order of submenus

Discussion in 'Editor & General Support' started by jusw85, Apr 16, 2020.

  1. jusw85

    jusw85

    Joined:
    Apr 21, 2016
    Posts:
    21
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Hello,

    You can use the same priority number for your whole hierarchy.

    For example, you can use the 100's for the "Tools/Submenu1", the 200's for the "Tools/Submenu2" and the 300's for the "Tools/Submenu3".

    In that case, you will have the "Tools/Submenu1" appearing first, then the "Tools/Submenu2" and finally the "Tools/Submenu3".

    Inside of each submenu, you can use, for example, the tens for ordering the "Items" inside.

    In that case, if you use the priority 110 for the "Tools/Submenu1/Item1" and 120 for "Tools/Submenu1/Item2", then the "Tools/Submenu1/Item1" will appear before "Tools/Submenu1/Item2" inside of the "Tools/Submenu1".


    I wish you an Enjoyable Menu Creation! :)
     
    zwcloud likes this.
  3. jusw85

    jusw85

    Joined:
    Apr 21, 2016
    Posts:
    21
    Got it, thanks!

    One thing to add for anyone else interested, the changes won't bite until the Editor is restarted.

    Cheers!
     
    JonathanFri, zwcloud, TimGS and 2 others like this.
  4. Logarius_

    Logarius_

    Joined:
    Feb 20, 2021
    Posts:
    4
    it takes me a long time to think why the menu haven't sorted ... unitl i follow you to restart the editor ...thanks a lot ...