Search Unity

Can I create a custom menu AFTER the help menu?

Discussion in 'Scripting' started by A_Savvidis, Nov 5, 2021.

  1. A_Savvidis

    A_Savvidis

    Joined:
    Jul 21, 2016
    Posts:
    98
    Priority parameter doesn't seem to help with that. I've tried 2147483647 and even that placed my menu before "Window"
     
  2. Nefisto

    Nefisto

    Joined:
    Sep 17, 2014
    Posts:
    333
    If you're talking about menus in canvas, the hierarchy order defines which one will be drawn first, if your "pause" is before "menu" in the hierarchy it will be drawn first and menu after.
     
  3. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    3,983
    You simply can't. Custom MenuItems are just an extension of the Unity editor and those are inserted before the native Window menu. The priority is only used to relatively order other custom menu items relatively to each other.

    The main menu is part of the native editor application and not part of the managed world. Of course in theory they could have assigned each main menu item an artificial priority, however this would not really serve any good as people could place menus all over the place. It's common practise that the window and help menu are the last two menus while the File menu is always the first.

    You should use main menu items sparely as it can quickly clutter the main menu. Think about it. If you use like 30 different assets from other people and everyone creates his own main menu item. I prefer to stick to the artificial "Tools" menu and use sub menus below that and I've seen others doing the same thing. So this has become a sort of de-facto standard, though of course not a rule. If you think your extension is important enough so it needs a seperate main menu item, go for it ^^. Especially if it's just used in-house you can of course do whatever you want. However you can not put a main menu item after the Help menu.
     
    Nefisto likes this.
  4. A_Savvidis

    A_Savvidis

    Joined:
    Jul 21, 2016
    Posts:
    98
    Thank you and no it was for internal personal usage only so it would be ok after Help but I understand why Unity doesn't allow that.