https://github.com/normandy72/unity-dropdown
How to create a Dropdown Menu in Unity.
https://github.com/normandy72/unity-dropdown
csharp dropdown dropdownmenu unity
Last synced: about 1 month ago
JSON representation
How to create a Dropdown Menu in Unity.
- Host: GitHub
- URL: https://github.com/normandy72/unity-dropdown
- Owner: Normandy72
- Created: 2023-04-07T14:03:10.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T15:06:00.000Z (about 3 years ago)
- Last Synced: 2025-01-14T12:46:23.772Z (over 1 year ago)
- Topics: csharp, dropdown, dropdownmenu, unity
- Language: ShaderLab
- Homepage:
- Size: 1.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Instructions
1. Create a __Canvas__, change its color if needed.
2. Add a __Dropdown__, change its color, font, font size, etc. if needed.
3. You can remove all options from the dropdown to add them dynamically via script.
4. Create a new script ("DropdownHandler").
5. Clear all options at Start (`dropdown.options.Clear();`).
6. Create List that contains all items for dropdown. Add as many items as you need.
7. Add all items to Dropdown as OptionData (`dropdown.options.Add(new Dropdown.OptionData() {text = item});`).
8. Create a delegate to a DropdowmItemSelected method.
9. Create __DropdownItemSelected__ method, ad its logic.
10. Call this method in Start.