How set order in [MenuItem] attribute like in [CreateAssetMenu] attribute?

So with:

[CreateAssetMenu(fileName = "Surface_DB", menuName = "Database/Surface_Database", order = 1)]

i can set order in menu, but i switch to editor script because i can do more then just create new asset in root folder and now i must use:


there no parameter order, i can’t use [CreateAssetMenu] attribute in editor script but [MenuItem] not have parameter order.

How i can add order to editor script or alernatives to [MenuItem] attribute in editor script?

The MenuItem attribute does have an order, it’s just not called order but priority ^^. Just have a look at the constructor. Make sure you read the note about the priority at the end. When you have a difference of 11 or greater between two items Unity will insert a divider in the menu. Also keep in mind that you can create sub menus which is the usual way to logically group several menus.

order = x does work, it’s just tedious to find the correct value.

order = -1 will put your MenuItem at the very top of the Asets/Create menu.

order = ~500+ will put it at the bottom.

I ended up using order = 281 to put my MenuItem in it’s own separator group, in between AudioMixer and Material.
It’s very trial and error unless you can find where Unity defines these.

Note: To actually update the order, you’ll need to change it in code, compile, THEN close unity. Then reopen unity to see where it landed. Not the most ideal solution, but it worked for me!