Class Dropdown.OptionData
Stores the text and/or image of a single option in the dropdown list.
Inherited Members
Namespace: UnityEngine.UI
Assembly: UnityEngine.UI.dll
Syntax
[Serializable]
public class Dropdown.OptionData
Constructors
OptionData()
Creates an empty OptionData.
Declaration
public OptionData()
OptionData(string)
Creates an OptionData with the specified text.
Declaration
public OptionData(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The label to display for this option. |
OptionData(string, Sprite)
Creates an OptionData with text and an image.
Declaration
public OptionData(string text, Sprite image)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The label to display for this option. |
| Sprite | image | The sprite to display for this option. |
OptionData(Sprite)
Creates an OptionData with the specified image.
Declaration
public OptionData(Sprite image)
Parameters
| Type | Name | Description |
|---|---|---|
| Sprite | image | The sprite to display for this option. |
Properties
image
The image associated with the option.
Declaration
public Sprite image { get; set; }
Property Value
| Type | Description |
|---|---|
| Sprite |
text
The text associated with the option.
Declaration
public string text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |