![](/img/trans.png)
[英]How can I add a option to a GameObject in the Hierarchy context menu?
[英]Can we add Menu Items in the GameObject menu that doesn't display in the context menu of the hierarchy window?
我想創建自己的菜單項,其行為類似於“創建空子項”統一默認方法。
此方法在GameObject菜單中顯示如下: GameObject Menu,但不在層次結構窗口的上下文菜單中顯示(右鍵單擊): Hierarchy Context Menu
我最終找到了解決方法:當您不精確確定優先級並且該方法位於GameObject菜單的根目錄時,它可以工作。 我知道,這很奇怪。
例如: [MenuItem ("GameObject/MyButton", false)]
有效,但[MenuItem ("GameObject/MyButton", false, -1)]
或[MenuItem ("GameObject/Subfolder/MyButton", false)]
不起作用工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.