- Home /
How can I make a small context menu in the inspector?
Hi all
Is it possible to make a menu like this pop-up when pressing a button in the inspector? I understand the basics of CustomEditor scripts and how to get a button working, I'm just looking for a way to make the menu.
Thanks, Ves
Answer by VesuvianPrime · Jul 30, 2014 at 11:28 AM
The answer I was actually looking for was to use GenericMenus:
Answer by SeeSharp · May 04, 2014 at 10:14 PM
Hi,
Are you asking for something like the light 'selection'?(Example below)
Or the one where you right-click to bring that menu up?
If you are talking about the one where you right-click to bring that menu up, then I'm sorry, but to my knowledge, it is impossible. Notice key word: To my knowledge.
If you want something like in the picture I provided, then you need a custom inspector with a ComboBox. Here's two tutorials I found and used about custom inspectors: Unity's official tutorial, and an 'unofficial' tutorial.
You could probably get a ComboBox tutorial from Unity's official documentation, or another source.
Please ask if you need further assistance.
Best of luck,
SeeSharp.
Hmm, I suppose I could make do with a combo box, but it's gonna be ugly. Thanks for the advice.
No problem. Please be sure to mark my answer correct if it answered your question :).
Oh and I'm not 100% sure that it's impossible to have the context menu, as I have never seen this get done before.
Best of luck,
SeeSharp.
Answer by 0V3RR1D3 · May 04, 2014 at 09:45 PM
Coudent you use an enum? - http://unity3d.com/learn/tutorials/modules/beginner/scripting/enumerations
Your answer
