- Home /
Unity5 "MenuItem" not work under build-in menu
public class ObjExporter : ScriptableObject
{
//[MenuItem("File/Export/Wavefront OBJ")]
[MenuItem("HxTools/Export Wavefront OBJ")]
static void DoExportWSubmeshes()
{
}
}
When with [MenuItem("HxTools/Export Wavefront OBJ")]
the menu works well.
But not for first [MenuItem("File/Export/Wavefront OBJ")]
DO it matter when I put in the build - in File menu ?
I have googled and the doc of unity. Found none valuable info.
thanks for any hint ?
Regards!
Hi @jzq740176597! Both menu paths work just fine for me. If that's not what you're seeing it might be worth reporting a bug.
Apart from the fact that "File/Export" doesn't make much sense in Unity. The "File" menu in Unity is only for "projects" and "scenes" as those are the only things that can be "opened" in Unity. Everything related to specific assets should go into the Assets menu and everything related to gameobjects into the "GameObject" menu.
However it's usually better to use a custom menu as things get easily overlooked inside the standard menus. I usually put my tools inside a seperate "Tools" menu and sometimes even in a submenu of the Tools menu if it's appropriate.
$$anonymous$$enu items to open custom editor windows are best placed inside the Window menu.
Your answer
Follow this Question
Related Questions
Importing 4.6 Asset ruined my 5.0 project 0 Answers
Animation Preview in Custom Asset Inspector Window 2 Answers
How can I determine OnSelectionChanged() caused by User click or by editor script in Hierarchy? 0 Answers
Showing file extension on Project tab 2 Answers
Unity Editor: Vertical scrollbar in flexible Editor Window 1 Answer