Creating text and image icon UI Dropdown menus
In the previous recipe, we created radio-style buttons with a Toggle Group, to present the user with a choice of one of many options. Another way to offer a range of choices is with a drop-down menu. Unity provides the UI Dropdown control for such menus. In this recipe, we'll offer the user a drop-down choice for the suit of a deck of cards (hearts, clubs, diamonds, or spades).
Note, the UI Dropdown created by default includes a scrollable area, in case there isn't space for all the options. We'll learn how to remove the GameObjects and components, to reduce complexity when such a feature is not required.
Then we'll learn how to add icon images with each menu option, as shown in the screenshot:

Getting ready
For this recipe, we have prepared the image that you need in a folder named Images in the 02_10
folder.
How to do it...
To create a UI Dropdown control GameObject, follow these steps:
- Create a new Unity 2D project.
- AddUI Dropdownto the scene.
- In...