ドキュメント

Unity Engine

Unity Engine

DropdownField

Construct an empty DropdownField.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

Construct an empty DropdownField.
public DropdownField()
Construct a DropdownField with a Label in front.
public DropdownField(string label)

Parameters

label

The label to display in front of the field.
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.

defaultValue

The default value selected from the dropdown.

formatSelectedValueCallback

Callback to format the selected value.

formatListItemCallback

Callback to format the list items displayed in the dropdown.
Construct a DropdownField.
public DropdownField(string label, List<string> choices, string defaultValue, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)

Parameters

label

The label to display in front of the field.

The list of choices to display in the dropdown.

defaultValue

The default value selected from the dropdown.

formatSelectedValueCallback

Callback to format the selected value.

formatListItemCallback

Callback to format the list items displayed in the dropdown.
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.

defaultIndex

The index of the choice selected by default.

formatSelectedValueCallback

Callback to format the selected value.

formatListItemCallback

Callback to format the list items displayed in the dropdown.
Construct a DropdownField.
public DropdownField(string label, List<string> choices, int defaultIndex, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)

Parameters

label

The label to display in front of the field.

The list of choices to display in the dropdown.

defaultIndex

The index of the choice selected by default.

formatSelectedValueCallback

Callback to format the selected value.

formatListItemCallback

Callback to format the list items displayed in the dropdown.