feat():大改前的提交,这个版本保存了所有冗余的代码

This commit is contained in:
2025-10-17 15:10:19 +08:00
parent 668bfe12eb
commit 3d03c59dc3
68 changed files with 2045 additions and 159 deletions

View File

@@ -0,0 +1,31 @@
using UnityEngine;
namespace Gameplay
{
// 用来加载卡牌数据的静态类
public static class CardLoader
{
public static CardData GetCardDataByID(int cardID)
{
CardData[] allCards = Resources.LoadAll<CardData>("Configs/Card");
foreach (var card in allCards)
{
if (card.CardID == cardID)
{
return card;
}
}
Debug.LogError($"Card with ID {cardID} not found!");
return null;
}
public static Card GetCardByID(int cardID)
{
CardData cardData = GetCardDataByID(cardID);
if (cardData != null)
{
return new Card(cardData);
}
return null;
}
}
}