- Home /
How to make a combo box
Hi, i need to make a gui in unity and provide a combo box widget. Any drop-down list will do. Basically I need to provide the user a list of strings and then know which one the user has selected. Any ideas?
thanks
Answer by Wolfram · Aug 06, 2010 at 12:46 PM
http://www.unifycommunity.com/wiki/index.php?title=SelectList
If you need custom strings, you can probably modify that script to do that.
thanks, it is close to what i want. do you know how to achieve the dropdown effect?
Sorry, I never really used UnityGUI, I found this script searching google and the unity community...which is generally a good idea to do. I am certain somebody already programmed a dropdown menu for Unity, you could find out how they did it there and use it for your case. $$anonymous$$ost liekly, it's an animation (iTween/Ani$$anonymous$$ate/Unity) that is triggered when you click the list.
Well, i think i will stick with that selectlist script for simplicity. thank you
Answer by dkozar · Jul 11, 2012 at 08:50 PM
There is, actually, a ComboBox in my framework, check it out: http://edrivenunity.com/form2
Danko
Answer by Uchiha Itachi · Feb 27, 2014 at 07:00 AM
I am very new to Unity, and I also want to do the same thing as yours. I am currently planning to use some UI combobox control which has the combobox dropdown property. I don't know if this be helpful to me or not. Anyway, the correct answer above offered seems to be practical!
Answer by vikingfabian-com · Aug 27, 2014 at 01:40 PM
Working example for editor GUI
int selected = 0;
string[] options = new string[]
{
"Option1", "Option2", "Option3",
};
selected = EditorGUILayout.Popup("Label", selected, options);
Your answer
Follow this Question
Related Questions
drop down list c# 1 Answer
A node in a childnode? 1 Answer
I need to create a drop DownList Like Structure in UI 0 Answers
ALWAYS SHOW DROPDOWN LIST 0 Answers
Does anyone know how to make a Dropdown inside an element of another Dropdown? 0 Answers