MenuItem属性

  The MenuItem attribute allows you to add menu items to the main menu. The MenuItem attribute turns any static function into a menu command. Only static functions can use the MenuItem attribute.

  To create a hotkey you can use the following special characters: % (ctrl on Windows, cmd on OS X), # (shift),& (alt), <b>_</b> (no key modifiers). For example to create a menu with hotkey shift-alt-g use "MyMenu/Do Something #&g". To create a menu with hotkey g and no key modifiers pressed use "MyMenu/Do Something _g".

  Some special keyboard keys are supported as hotkeys, for example "#LEFT" would map to shift-left. The keys supported like this are: LEFT, RIGHT, UP, DOWN, F1 .. F12, HOME, END, PGUP, PGDN.

  

  通过Selection类,可以获取当前编辑器选中对象的一些信息:

  

  EditorApplication.ExecuteMenuItem,提供执行编辑器的菜单的能力。

  

  EditorApplication类用于获取编辑器本身的信息,以及控制控制编辑器本身的行为。

参考:

1、file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/MenuItem.html

2、file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Selection.html

MenuItem属性的更多相关文章

  1. HTML5 学习总结(二)——HTML5新增属性与表单元素

    一.HTML5新增属性 1.1.contextmenu contextmenu的作用是指定右键菜单. <!DOCTYPE html> <html> <head> & ...

  2. HTML5 学习笔记(二)——HTML5新增属性与表单元素

    目录 一.HTML5新增属性 1.1.contextmenu 1.2.contentEditable 1.3.hidden 1.4.draggable 1.5.data-* 1.6.placehold ...

  3. HTML5新增标签与属性

    目录 一.HTML5新增属性 1.1.contextmenu 1.2.contentEditable 1.3.hidden 1.4.draggable 1.5.data-* 1.6.placehold ...

  4. EditorWindow 和MenuItem

    using UnityEngine; using System.Collections; using UnityEditor; public class ClipEventEditor : Edito ...

  5. HTML5入门以及新标签

    HTML5 学习总结(一)--HTML5入门与新增标签   目录 一.HTML5概要 1.1.为什么需要HTML5 1.2.什么是HTML5 1.3.HTML5现状及浏览器支持 1.4.HTML5特性 ...

  6. 【译】仿Taasky的3D翻转菜单动画实现

    最终效果 最终效果 开始 首先下载并打开一个事先搭好架子的Demo,然后来分析一下.这个Demo包含一个主页和详情页,其中MenuViewController继承自UITableViewControl ...

  7. Unity3D引擎扩展中的编辑器定制方法

    http://gamerboom.com/archives/36432 作者:Richard Fine Unity3D的方便之处在于,它很容易地扩展编辑器套件.每款游戏都对加工有着不同的需求,可以快速 ...

  8. Editor Scripting学习笔记之Menu Item

    主要用到: MenuItem属性 MenuCommand参数 可能用到: EditorApplication类 Selection类 GameObjectUtility类 FileUtil类 Undo ...

  9. Unity3D脚本中文系列教程(十七)

    http://dong2008hong.blog.163.com/blog/static/469688272014032332976/ ◆ Static function PrefixLabel(to ...

随机推荐

  1. linux 系统下配置java环境变量

    liunx桌面版本系统下载地址:http://www.ubuntukylin.com/downloads/ 1.源码包准备: 首先到官网下载jdk,http://www.oracle.com/tech ...

  2. UVA11538 Chess Queen

    题意 给一个\(n \times m\)的棋盘,输出有多少种方法放置两个互相攻击的皇后. \(n,m \leq 10^6\) 分析 参照刘汝佳的题解. 横.竖.斜三种情况互不相干,加法原理统计. 横竖 ...

  3. kong k8s 安装 以及可视化管理界面

    1. git  clone $ git clone git@github.com:Mashape/kong-dist-kubernetes.git $ cd kong-dist-kubernetes ...

  4. php项目有负载,$_SERVER['HTTP_X_FORWARDED_FOR']函数在不同系统中获取到的值形式不一样,ios系统苹果手机只能获取到一个ip(113.87.214.xxx),而安卓手机获取到的是2个ip中间逗号隔开的形式(113.87.214.xxx , xxx.xxx.xxx.xxx)

    这次由于有个抽奖活动功能,苹果手机每次都抽奖失败,安卓手机每次都抽奖失败(5台ios手机,8台Android手机). 错误日志查看是因为,抽奖用户的ip记录进数据库时出错,之前都是拿到ip直接插入数据 ...

  5. Ubuntu 16.04配置OpenGL教程

    sudo apt-get install build-essential sudo apt-get install libgl1-mesa-dev sudo apt-get install libgl ...

  6. HDOJ5875(线段树)

    Function Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total ...

  7. Nginx (一)Windows下编译Nginx源码以及安装 nginx for windows方法步骤

    转载自: http://apps.hi.baidu.com/share/detail/11192699#content Nginx介绍: Nginx ("engine x")是一个 ...

  8. Linux学习笔记 -- 文件包含

    简述 简单来讲,shell 中的文件包含指的是在一个文件中引用另外一个文件.通过这种方式,我们可以将一些公用的代码封装为一个独立的文件,并在需要的时候引用它即可. 语法 . filename # 注意 ...

  9. Vue语法

    第一个Vue示例: <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  10. RPC框架的服务注册和发现

    https://www.cnblogs.com/valor-xh/p/6281502.html https://blog.csdn.net/listslim1/article/details/5157 ...