code show as below:
[MenuItem("GameObject/生成带图片的Image", false, -100)]
public void Test()
{
}
The effect is as follows:
note:
- The priority parameter of MenuItem must be less than 50
- The itemName parameter of MenuItem only supports first-level paths (that is, itemName can only have one "/"). For example, "GameObject/aaa/bbb" is invalid and will not appear in the Hierarchy right-click menu