- Home /
Question by
laharl219 · Mar 17, 2016 at 06:04 PM ·
script.dropdowndynamically
How do i make a dropdown via script(not using the new UI)
Hello, i'm working on an app witch will hame a few dropdown menus, however, using the new UI i couldn't find a way to fill it dynamically. In order to fill it correctly i wanted o create the dropdown via script, can anyone help me? if possible give an example
Comment
Best Answer
Answer by jebemti · Mar 17, 2016 at 10:03 PM
There is a way to fill built-in Dropdown dynamically
Dropdown.ClearOptions to clear
Dropdown.AddOptions to add new options
In actions it looks something like this:
List<string> options = new List<string> ();
options.Add("On");
options.Add("Off");
dropdown.ClearOptions();
dropdown.AddOptions(options);