Hello, guys, I am a beginner. I want to know how to make a inputField with optional string items in custom Editor Inspector ? Or how to make PopUp 's field can be input? I need to make a field that I can input, and when I input , a list will show,. Just like a code compeletion helper in unity editor inspector. Can someone help me? Thanks
you can check out my tutorial on making function list dropdowns.
not all of it is useful in your case, and there I’m making only a drawer, but it’s the same principle in custom inspectors as well.
the exact line with the popup is the last spoiler box (in the end of the post), line 36
ask here if you have any problems understanding it, and also make sure to check out the docs.
now for your other question, regarding code completion input/popup, that’s a little harder to do.
I’d advise you to learn the basics of editors first. what you want is not impossible, but it could turn out to be tricky, because you need to create your own popup window, and make all of this cross-communicate, and track which control is selected, so that when you click somewhere popup goes away. all I can think of is basically to use a so-called combobox, that does most of these things for you, and work out a logic to repopulate its items whilst you type.
Like I said, MFC standard named these things combobox (a combination of input and dropdown, or dropbox as it was called), but over time different techs and standards adopted different namings.
You can look up for something similar on GitHub. I’ve found something named ‘SearchableEnumAttribute’ here, for example. Most of these projects come with MIT licence (I don’t know about this one in particular, be sure to check), but you can always check it out, see how it’s made.
Thanks so much! I was trying to make it with clickevent and focusControl