EditorGUILayout popup menu item

i want to make a dropdown menu item like UnityEvent since EditorGUILayout.Popup only take string array. Can anyone help me?

Popup does take a string array.

Maybe you don’t get my question, EditorGUILayout popup with string array sis ok but i want every item will point like a menu item

Do you mean submenus?

yes it is, look at the picture, it show sub menu like that

i figure it out. Just put string array like {“menu1/item1”, “menu1/item2”, “menu1/item3”, “menu2/item1”, “menu2/item2”} in EditorGUILayout.Popup will do the trick!

Yup, slashes. You can use them anywhere in the editor to create submenus.