DropdownField
Construct an empty DropdownField.
Read time 2 minutesLast updated 11 days ago
Definition
- Type: Constructor
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
DropdownField()
Construct an empty DropdownField.
public DropdownField()
DropdownField(string)
Construct a DropdownField with a Label in front.
public DropdownField(string label)
Parameters
The label to display in front of the field.
DropdownField(List<string>, string, Func<string, string>, Func<string, string>)
Construct a DropdownField.
public DropdownField(List<string> choices, string defaultValue, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
Parameters
The list of choices to display in the dropdown.
The default value selected from the dropdown.
Callback to format the selected value.
Callback to format the list items displayed in the dropdown.
DropdownField(string, List<string>, string, Func<string, string>, Func<string, string>)
Construct a DropdownField.
public DropdownField(string label, List<string> choices, string defaultValue, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
Parameters
The label to display in front of the field.
The list of choices to display in the dropdown.
The default value selected from the dropdown.
Callback to format the selected value.
Callback to format the list items displayed in the dropdown.
DropdownField(List<string>, int, Func<string, string>, Func<string, string>)
Construct a DropdownField.
public DropdownField(List<string> choices, int defaultIndex, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
Parameters
The list of choices to display in the dropdown.
The index of the choice selected by default.
Callback to format the selected value.
Callback to format the list items displayed in the dropdown.
DropdownField(string, List<string>, int, Func<string, string>, Func<string, string>)
Construct a DropdownField.
public DropdownField(string label, List<string> choices, int defaultIndex, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
Parameters
The label to display in front of the field.
The list of choices to display in the dropdown.
The index of the choice selected by default.
Callback to format the selected value.
Callback to format the list items displayed in the dropdown.