Adding to GameObject context menu WITHOUT [MenuItem(...)]

Hi there!

I’m trying to figure out how to add things to Unity’s GameObject context menu in the hierarchy window. When you right click on an object, you get the little menu with Copy, Paste, and so on. The problem though is I want to add things to that menu NOT USING this code: [MenuItem ("GameObject/Test", false, 30)]. I’m working on an editor script and I’m trying to figure out if I can dynamically add things (or remove) to this menu and I haven’t found anything online on this yet. Any ideas?

you can’t do this without this attribute. you’ll have to write code that rewrites or generates code using this attribute.