How to create a selection menu in the inspector for classes and their methods?
I'm working on creating a more robust version of Unity's event system to help facilitate development. While I already have it working in code, I'm trying to make a GUI to make things easier. I've been modeling the interface on what Unity already has for it's EventTrigger system.
The issue I'm running into is that I'm not sure how to actually display classes and methods can be selected for when an event triggers. I know how to get them (using reflection), but I'm not sure how to store them, or more importantly, get the interface for them.
What I would like to have, would be something like the EventTrigger system.
Does anyone know how to get something like this?
Answer by YinXiaozhou · Sep 23, 2016 at 07:46 AM
If you are saying you don't know how to create a same drop down menu. Try this,
selection = EditorGUILayout.Popup(selection, new string[]{"test1", "test2/submenu"});
This is exactly it! Thank you!
Now that I've got that down, I'm starting to bash my head against actually selecting the method I want to call. The only solution I can think of/find seems overly complex. I feel like this is something Unity might already have functionality for.
Your answer
Follow this Question
Related Questions
How to get spacing between inspector property labels and fields? 0 Answers
How to select a MonoBehaviour in inspector from a cusom editor? 0 Answers
GUILayout.Label with Texture2D on the same line in Inspector ? 1 Answer
Can't get Custom Editor to display 1 Answer
Add multiple custom editors for same type of object. 0 Answers