docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Dropdown.OptionData

    Stores the text and/or image of a single option in the dropdown list.

    Inheritance
    object
    Dropdown.OptionData
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)