- Home /
Where is the Context-Menu Located in Unity?
I want to make a function visible in the "context-menu" of my object, using [ContextMenu("Context-Menu")]
followed by a function definition. However, I can't seem to find the context menu in the inspector. So, it seems that I can't make use of this feature right now because I can't find the context menu in Unity.
Answer by burnumd · Feb 14, 2011 at 10:00 PM
In the inspector, each component has a small gear-shaped icon in the upper right-hand corner of the panel. Clicking that gear will display the component's context menu. When you've set a ContextMenu attribute for a function, it should appear at the bottom of the context menu for that component.
Note that the component must be added to a GameObject and you must be viewing that GameObject in the Inspector for the context menu to appear (ie, it will not appear if you simply select the script in the "Project" pane).
Answer by SteveFSP · Dec 07, 2010 at 05:40 PM
A context-menu is the menu that appears when you right-click or hold-click the mouse over the area associated with the menu. In your case, the inspector. So position the mouse over the inspector and, for a two button mouse, right-click. If there is a menu associated with the inspector, it should appear.
For a one button mouse, I think it is to click and hold.
Right click the component, or right-click the inspector? Umm... It didn't work. These things I've already tried and I couldn't find them. If anyone has like a screen cap showing me this context menu, that would be awesome. $$anonymous$$aybe I'm too thick to understand everyone's complicating words.
How about updating your question with an example of your code? Then I can try it out and possibly give you a step-by-step.
Your answer
Follow this Question
Related Questions
Extending the Project View 2 Answers
Determine the Scene that is selected when using context menu 0 Answers
Procedural Context Menu 0 Answers
Adding to GameObject context menu WITHOUT [MenuItem(...)] 1 Answer