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.

alt text

Thanks,
Ves

Hi,

Are you asking for something like the light ‘selection’?(Example below)

alt text

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.

The answer I was actually looking for was to use GenericMenus:

Coudent you use an enum? - http://unity3d.com/learn/tutorials/modules/beginner/scripting/enumerations