feat(): 大量更新

This commit is contained in:
2025-10-15 21:31:13 +08:00
parent 546f08c53a
commit 668bfe12eb
178 changed files with 11318 additions and 446 deletions

View File

@@ -0,0 +1,48 @@
using System;
using UnityEngine;
namespace Gameplay
{
public class CardBook
{
public CardBookData Data;
public CardSlot[] Slots;
public CardSlot[] Spares;
public CardBook(CardBookData data)
{
Data = data;
Slots = new CardSlot[Data.SlotCount];
Spares = new CardSlot[Data.SpareCount];
for (int i = 0; i < Slots.Length; i++)
{
Slots[i] = new CardSlot();
}
for (int i = 0; i < Spares.Length; i++)
{
Spares[i] = new CardSlot();
}
}
// Get all cards in the card book,and not Spares
public Card[] GetCards()
{
var cards = new Card[Slots.Length + Spares.Length];
for (int i = 0; i < Slots.Length; i++)
{
cards[i] = Slots[i].StoredCard;
}
return cards;
}
public Card[] GetSpareCards()
{
var cards = new Card[Spares.Length + Spares.Length];
for (int i = 0; i < Spares.Length; i++)
{
cards[i] = Spares[i].StoredCard;
}
return cards;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4bb8bfb17c6a4eaa88954871942ee72d
timeCreated: 1760422530

View File

@@ -0,0 +1,12 @@
using UnityEngine;
namespace Gameplay
{
[CreateAssetMenu(fileName = "CardBookData", menuName = "ScriptableObject/CardBookData", order = 1)]
public class CardBookData : ScriptableObject
{
public int SlotCount;
public int SpareCount;
public int MaxLoopCount;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 54f1f8ff48b84542962110e7a9851917
timeCreated: 1760422573

View File

@@ -0,0 +1,12 @@
using UnityEngine;
namespace Gameplay
{
// 卡牌书的显示相关脚本
public class CardBookViewer : MonoBehaviour
{
[SerializeField] private Transform LeftHandPoint;
private CardBook CardBook;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 68803a8f56734f22a3025f8028fc027f
timeCreated: 1760431288

View File

@@ -0,0 +1,23 @@
namespace Gameplay
{
public class CardSlot
{
public Card StoredCard;
public bool IsEmpty => StoredCard == null;
public int ActiveTimes = 0;
public void StoreCard(Card card)
{
StoredCard = card;
ActiveTimes = 0;
}
public Card RemoveCard()
{
var card = StoredCard;
StoredCard = null;
ActiveTimes = 0;
return card;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e5f566603b3f4286965da48bb49c018a
timeCreated: 1760422548