Dropdown
info
- This class is only available in a Local environment
The Dropdown class is a component which interacts with Unity Dropdowns on UI and 3D.
caution
The Dropdown class is only compatible with TextMeshPro.
To get a Dropdown from an item, use the GetComponent method.
let dropdownComponent = item.GetComponent("Dropdown")
You can then use the dropdownComponent
property to access the Dropdown class.
Methods
Method Name | Return Type | Parameters | Description |
---|---|---|---|
GetValue | int | none | Gets the current index of the selected value |
SetValue | void | int | Sets the current index |
RegisterValueChanged | void | function(int) | Registers an event for when the selected index is changed |
RemoveAllValuesChanged | void | none | Removes all events for when the selected index is changed |
GetColorBlock | ColorBlock? | none | Gets the ColorBlock for the element |
SetColorBlock | void | ColorBlock | Sets the ColorBlock for the element |