AddComponentMenu 添加组件菜单
Inherits from Attribute
The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu, instead of just the "Component->Scripts" menu.
AddComponentMenu属性允许你在"Component"菜单中放置一个无论在哪的脚本,而不是仅仅在"Component->Scripts"菜单中。
You use this to organize the Component menu better, this way improving workflow when adding scripts. Important notice: You need to restart
你可以用它来更好的组织组件菜单,这种方式可以改善工作流程当你添加脚本的时候。重要提示:你需要重启
// Javascript example
@script AddComponentMenu ("Transform/Follow Transform")
class FollowTransform extends MonoBehaviour {
}
// C# example:
[AddComponentMenu("Transform/Follow Transform")]
class FollowTransform : MonoBehaviour
{
}
Constructors构造器
-
The script will be placed in the component menu according to menuName. menuName is the path to the component
这个脚本将会被放置在组件菜单根据menuName(菜单名称)。menuName是组件的路径。
最后修改:2011年5月18日 Wednesday 16:19