I’ve been experimenting with creating custom Inspectors and Editor Windows in Unity lately and one of the features I’ve found is the GenericMenu
class. This allows you to create Drop Down and Context Menu’s in Unity.
To draw a Context Menu with two options (Foo and Bar) which will print themselves to the Unity Console when clicked the code might look something like this:
|
|
The documentation for GenericMenu
is also on Unity’s scripting references with additional examples: https://docs.unity3d.com/ScriptReference/GenericMenu.html
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u