增加新版出战卡组选定功能和删除功能

This commit is contained in:
YiHan0621
2025-09-19 18:32:19 +08:00
parent 6e3e6b59a5
commit fadcb295d2
5 changed files with 211 additions and 64 deletions

View File

@@ -136,7 +136,6 @@ namespace TcgEngine.UI
hidden = false;
if(this.title!=null)
this.title.text = deck.title;
}
public void SetLine(string title)
@@ -185,6 +184,47 @@ namespace TcgEngine.UI
gameObject.SetActive(false);
}
#region ================== ==================
/// <summary>
/// 重置数据并隐藏
/// </summary>
public void ResetLine()
{
card = null;
variant = null;
deck = null;
udeck = null;
hidden = true;
hover = false;
if (title) title.text = "";
if (value) { value.text = ""; value.enabled = false; }
if (cost) cost.value = 0;
if (image) image.enabled = false;
if (frame) frame.enabled = false;
if (delete_btn) delete_btn.SetVisible(false);
gameObject.SetActive(false);
}
/// <summary>
/// 刷新用户自定义牌组
/// </summary>
public void Refresh(UserData udata, UserDeckData udeck)
{
SetLine(udata, udeck);
}
/// <summary>
/// 刷新单卡
/// </summary>
public void Refresh(CardData card, VariantData variant, int quantity, bool invalid = false)
{
SetLine(card, variant, quantity, invalid);
}
#endregion
public CardData GetCard()
{
return card;