Skip to main content

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 NameReturn TypeParametersDescription
GetValueintnoneGets the current index of the selected value
SetValuevoidintSets the current index
RegisterValueChangedvoidfunction(int)Registers an event for when the selected index is changed
RemoveAllValuesChangedvoidnoneRemoves all events for when the selected index is changed
GetColorBlockColorBlock?noneGets the ColorBlock for the element
SetColorBlockvoidColorBlockSets the ColorBlock for the element