出战卡组UI

This commit is contained in:
YiHan0621
2025-09-19 14:07:19 +08:00
parent f3199704b8
commit 6e3e6b59a5
137 changed files with 11050 additions and 751 deletions

View File

@@ -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();