メインコンテンツまでスキップ

Class YauiDropdown

A selectable that picks one of its options from a list, like uGUI's Dropdown. The list is a copy of Yaui.YauiDropdown.Template (an inactive element, typically a scroll view) shown on top of the panel below the dropdown, with a copy of the template's item (the toggle around Yaui.YauiDropdown.ItemText) for each option. Presses outside the list close it.

Assembly: Yaui.dll​
View Source​
Declaration
public class YauiDropdown : YauiSelectable, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IMoveHandler, IPointerClickHandler, ISubmitHandler, ICancelHandler

Inheritance: System.Object -> Yaui.YauiSelectable

Implements:

Expand

IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IMoveHandler, IPointerClickHandler, ISubmitHandler, ICancelHandler

Properties​

Template​

View Source​
Declaration
public YauiElement Template { get; set; }

CaptionText​

View Source​
Declaration
public YauiText CaptionText { get; set; }

CaptionImage​

View Source​
Declaration
public YauiImage CaptionImage { get; set; }

ItemText​

View Source​
Declaration
public YauiText ItemText { get; set; }

ItemImage​

View Source​
Declaration
public YauiImage ItemImage { get; set; }

Options​

The options. Call Yaui.YauiDropdown.RefreshShownValue() after changing them in place.

View Source​
Declaration
public List<YauiDropdown.OptionData> Options { get; set; }

Value​

The index of the selected option.

View Source​
Declaration
public int Value { get; set; }

OnValueChanged​

View Source​
Declaration
public YauiDropdown.DropdownEvent OnValueChanged { get; set; }

IsExpanded​

Whether the list is shown.

View Source​
Declaration
public bool IsExpanded { get; }

Methods​

SetValueWithoutNotify(int)​

View Source​
Declaration
public void SetValueWithoutNotify(int input)
Parameters​
TypeName
System.Int32input

AddOptions(IEnumerable<string>)​

View Source​
Declaration
public void AddOptions(IEnumerable<string> texts)
Parameters​
TypeName
System.Collections.Generic.IEnumerable<System.String>texts

AddOptions(IEnumerable<OptionData>)​

View Source​
Declaration
public void AddOptions(IEnumerable<YauiDropdown.OptionData> data)
Parameters​
TypeName
System.Collections.Generic.IEnumerable<Yaui.YauiDropdown.OptionData>data

ClearOptions()​

View Source​
Declaration
public void ClearOptions()

OnEnable()​

View Source​
Declaration
protected override void OnEnable()

OnDisable()​

View Source​
Declaration
protected override void OnDisable()

OnValidate()​

View Source​
Declaration
protected override void OnValidate()

RefreshShownValue()​

Shows the selected option in the caption.

View Source​
Declaration
public void RefreshShownValue()

OnPointerClick(PointerEventData)​

View Source​
Declaration
public virtual void OnPointerClick(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnSubmit(BaseEventData)​

View Source​
Declaration
public virtual void OnSubmit(BaseEventData eventData)
Parameters​
TypeName
BaseEventDataeventData

OnCancel(BaseEventData)​

View Source​
Declaration
public virtual void OnCancel(BaseEventData eventData)
Parameters​
TypeName
BaseEventDataeventData

Show()​

Shows the list below the dropdown (above it if there is no room below).

View Source​
Declaration
public void Show()

Hide()​

Hides the list.

View Source​
Declaration
public void Hide()

Implements​

  • IPointerEnterHandler
  • IPointerExitHandler
  • IPointerDownHandler
  • IPointerUpHandler
  • ISelectHandler
  • IDeselectHandler
  • IMoveHandler
  • IPointerClickHandler
  • ISubmitHandler
  • ICancelHandler