對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2014/12/10 10:00:11
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 構造器
- AddComponentMenuThe 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
原文出處: AddComponentMenu 添加组件菜单