Search Unity

Bug [SOLVED][Linux] Unable to add a new menu item into Unity3D editor toolbar

Discussion in 'Linux' started by unity_vjl, Mar 8, 2016.

  1. unity_vjl

    unity_vjl

    Joined:
    Mar 4, 2016
    Posts:
    5
    I'm using Debian 8 and installed Unity3D Build #2016022301.

    I'm not getting to add a new menu item into editor toolbar.

    I followed the instructions given by:

    Unity - Scripting API: MenuItem (version 5.3)
    http://docs.unity3d.com/ScriptReference/MenuItem.html

    UNITY EDITOR EXTENSIONS – MENU ITEMS
    https://unity3d.com/learn/tutorials/modules/intermediate/editor/menu-items

    I created a file named MenuTest.cs and inserted the code example from Unity - Scripting API: MenuItem.

    Then I tried to put MenuTest.cs into /opt/Unity/Editor, /opt/Unity/Editor/Scripts, Editor folder inside the current project and Assets/Scripts folder. Reinitialize Unity editor.

    But no new menu item were inserted into toolbar.
     
  2. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    Put the script into your project folder + /Assets/Editor instead.

    Edit: The quickest way to do that is to right click in the project browser (in Unity) and create a folder called "Editor", then put your script in there.
     
    Last edited: Mar 8, 2016
  3. unity_vjl

    unity_vjl

    Joined:
    Mar 4, 2016
    Posts:
    5
    OK, it works when putting the script into project/Assets/Editor.

    Thanks