purpose
The Hierarchy window in the right menu to add items to quickly achieve some functions, such as: custom UI creation and so on. Reference uGUI source code found not to add success:
[MenuItem("GameObject/UI/Text", false, 2000)]
static public void AddText(MenuCommand menuCommand)
{
GameObject go = DefaultControls.CreateText(GetStandardResources());
PlaceUIElementRoot(go, menuCommand);
}
Copy the code
why
According to the API manual, it turns out that you need to change the priority to 10, but if you can only set it to 10, you can’t get to the order that you want it to be below the UI, not below it. Later, I found that someone searched and summarized as follows:
Title menu bar priority:Right click menu priority:
reference
Answers.unity.com/questions/2…