Option properties

The Value property represents which option is currently selected. The options are in a list, and the number in the Value property represents the currently selected option's index within the list. Since the options are represented by their indices, the first option has a Value of 0 (not 1).

The Options property lists out all the options within the Dropdown menu. Within the list, each option has a text string and sprite (optional). All strings and sprites within this list will automatically swap into the correct component properties of the children of Dropdown, based on the properties of the Dropdown component. So, you will not have to write any code to ensure that these items display appropriately when the player interacts ...

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.