关闭

Unity3D Editor在右键弹出菜单中添加 item

330人阅读 评论(0) 收藏 举报


   [MenuItem("Assets/StuffDoSomething")]

    static void DoubleMass(MenuCommand command)

    {


    }



三种特殊的:

  • Assets – items will be available under the “Assets” menu, asWELL using right-click inside the project view.

  • Assets/Create – items will be listed when clicking on the “Create” button in the project view (useful when adding new types that can be added to the project)

  • CONTEXT/ComponentName – items will be available by right-clicking inside the inspector of the given component.




在menu item中添加快捷键

  • % – CTRL on Windows / CMD on OSX

  • # – Shift

  • & – Alt

  • LEFT/RIGHT/UP/DOWN – Arrow keys

  • F1…F2 – F keys

  • HOME, END, PGUP, PGDN

// Add a new menu item with hotkey CTRL-SHIFT-A
 
[MenuItem("Tools/New Option %#a")]
private static void NewMenuOption()
{
}
 
// Add a new menu item with hotkey CTRL-G
 
[MenuItem("Tools/Item %g")]
private static void NewNestedOption()
{
}
 
// Add a new menu item with hotkey G
[MenuItem("Tools/Item2 _g")]
private static void NewOptionWithHotkey()
{
}


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:13315次
    • 积分:284
    • 等级:
    • 排名:千里之外
    • 原创:13篇
    • 转载:15篇
    • 译文:1篇
    • 评论:0条