完善抽卡界面以及根据优化意见和功能缺失做出调整

This commit is contained in:
YiHan0621
2025-10-13 01:41:20 +08:00
parent 2e4a318ca3
commit f14b8d6ac6
14 changed files with 702 additions and 304 deletions

View File

@@ -19,6 +19,8 @@ namespace TcgEngine.Client
public float card_angle = 10f;
public float card_offset_y = 10f;
public UIPanel buyButton;
private List<HandPack> packs = new List<HandPack>();
private Vector3 start_pos;
@@ -66,6 +68,7 @@ namespace TcgEngine.Client
public void RefreshPacks()
{
UserData udata = Authenticator.Get().UserData;
Debug.Log("玩家卡包有:"+udata.packs.Length+"种");
foreach (UserCardData pack in udata.packs)
{
Debug.Log("服务器返回的卡包tid" + pack.tid+",");
@@ -75,9 +78,10 @@ namespace TcgEngine.Client
PackData dpack = PackData.Get(pack.tid);
if (dpack != null && !HasPack(pack.tid))
SpawnNewPack(pack);
Debug.Log($"其中有{pack.tid}:{pack.quantity}个");
}
//Remove removed cards
// 移除已移除的卡片
for (int i = packs.Count - 1; i >= 0; i--)
{
HandPack pack = packs[i];
@@ -88,6 +92,15 @@ namespace TcgEngine.Client
pack.Remove();
}
}
if (udata.packs==null || udata.packs.Length == 0)
{
buyButton.Show();
}
else
{
buyButton.Hide();
}
}
void Update()