出战卡组UI
This commit is contained in:
@@ -64,12 +64,18 @@ namespace TcgEngine.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置
|
||||
/// </summary>
|
||||
public void SetValue(int index)
|
||||
{
|
||||
if (index >= 0 && index < dropdown.options.Count)
|
||||
dropdown.value = index;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更改
|
||||
/// </summary>
|
||||
private void OnChangeValue(int selected_index)
|
||||
{
|
||||
if (selected_index >= 0 && selected_index < values.Count)
|
||||
@@ -80,6 +86,10 @@ namespace TcgEngine.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取选中项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DropdownValueItem GetSelected()
|
||||
{
|
||||
if (dropdown.value >= 0 && dropdown.value < values.Count)
|
||||
@@ -90,6 +100,10 @@ namespace TcgEngine.UI
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取选定值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSelectedValue()
|
||||
{
|
||||
DropdownValueItem item = GetSelected();
|
||||
@@ -97,7 +111,10 @@ namespace TcgEngine.UI
|
||||
return item.id;
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取选定文本
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSelectedText()
|
||||
{
|
||||
DropdownValueItem item = GetSelected();
|
||||
|
||||
Reference in New Issue
Block a user