- Create a Canvas, change its color if needed.
- Add a Dropdown, change its color, font, font size, etc. if needed.
- You can remove all options from the dropdown to add them dynamically via script.
- Create a new script ("DropdownHandler").
- Clear all options at Start (
dropdown.options.Clear();
). - Create List that contains all items for dropdown. Add as many items as you need.
- Add all items to Dropdown as OptionData (
dropdown.options.Add(new Dropdown.OptionData() {text = item});
). - Create a delegate to a DropdowmItemSelected method.
- Create DropdownItemSelected method, ad its logic.
- Call this method in Start.
normandy72 / unity-dropdown Goto Github PK
View Code? Open in Web Editor NEWHow to create a Dropdown Menu in Unity.