2+ level Popup on InspectorGUI
I'm making and inspector GUI for creating NPCs easily through the inspector rather than searching the models on its folder. And I've found that, if a give to the EditorGUILayout.Popup an array of Paths, it will make sublevels for the folders shared for all objects, but not for the different ones.
So if I have a folder for people, and another for animals, both on Assets/Models/, On the inspector I would navigate through a first Asset menu, then a Models menu, and inside it I would see a list like this: People/womanA People/womanB People/manA Animals/Dog Animals/Cat
While the first submenus are annoying and I don't want them, I would like that the same structure worked form People and Animals folder, so I chose People>womanA rather than a single string with the whole path. Is there a way for doing so?
Answer by Lathspell · Nov 22, 2016 at 12:26 PM
Stupid error, I'm just gonna state it here in case someone need it. Unity owkrs with "/" while I was searching the folder structure, which works with "\". So Unity understood the first symbols coming from Aplication.dataPath but not the other ones. Make sure to replace them
Your answer
![](https://koobas.hobune.stream/wayback/20220612101146im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Custom Inspector changes not updating target in Edit Mode 1 Answer
Custom Editor List with child classes 1 Answer
[Editor]Get FieldInfo by using an instance of that field 1 Answer
Is there a way to live-update script-controlled UI formatting in the editor? 0 Answers
Dynamically sized list of toggles in custom inspector? 0 Answers