出战卡组实时切换展示
This commit is contained in:
@@ -14,7 +14,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
id: spell_split
|
||||
title: "\u5206\u88C2"
|
||||
art_full_path: Cards/imp.png
|
||||
art_full_path: Cards/fire_chicken.png
|
||||
art_board_path: CardsBoard/imp_board.png
|
||||
type: 20
|
||||
camp: 0
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace TcgEngine.UI
|
||||
|
||||
// 卡组展示管理
|
||||
public int card_lines_size = 12;
|
||||
private List<DeckLine> card_pool = new List<DeckLine>();
|
||||
private List<DeckLine> card_lines = new List<DeckLine>();
|
||||
private List<UserCardData> deck_cards = new List<UserCardData>();
|
||||
public List<DeckLine> card_pool = new List<DeckLine>();
|
||||
public List<DeckLine> card_lines = new List<DeckLine>();
|
||||
|
||||
|
||||
private UserData lastUserData;
|
||||
private int currIndex = 0;
|
||||
@@ -116,7 +116,7 @@ namespace TcgEngine.UI
|
||||
{
|
||||
deckSelector.SelectDeck(active_lines[0].GetUserDeck().tid);
|
||||
currIndex += 1;
|
||||
// SetupUserCardList();
|
||||
SetupUserCardList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace TcgEngine.UI
|
||||
deckSelector.SelectDeck(line.GetUserDeck().tid);
|
||||
// 获取索引
|
||||
currIndex = active_lines.IndexOf(line) + 1;
|
||||
// SetupUserCardList();
|
||||
SetupUserCardList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -153,24 +153,29 @@ namespace TcgEngine.UI
|
||||
|
||||
#region 展示卡组
|
||||
|
||||
// private void SetupUserCardList()
|
||||
// {
|
||||
// foreach (var line in card_pool)
|
||||
// line.ResetLine();
|
||||
//
|
||||
// card_lines.Clear();
|
||||
//
|
||||
// for (int i = 0; i < active_lines[GetCurrIndex()].GetUserDeck().cards.Length; i++)
|
||||
// {
|
||||
// DeckLine line = card_pool[i];
|
||||
// }
|
||||
// }
|
||||
private void SetupUserCardList()
|
||||
{
|
||||
foreach (var line in card_pool)
|
||||
line.ResetLine();
|
||||
|
||||
card_lines.Clear();
|
||||
|
||||
UserDeckData udeck = active_lines[GetCurrIndex()].GetUserDeck();
|
||||
Debug.Log("卡组数量:"+udeck.cards.Length);
|
||||
for (int i = 0; i < udeck.cards.Length; i++)
|
||||
{
|
||||
UserCardData ucard = udeck.cards[i];
|
||||
DeckLine line = card_pool[i];
|
||||
|
||||
// private CardData GetCardData(string id)
|
||||
// {
|
||||
// CardData card = CardData.Get();
|
||||
// return null;
|
||||
// }
|
||||
CardData cdata = CardData.Get(ucard.tid);
|
||||
VariantData variant = VariantData.Get(ucard.variant);
|
||||
|
||||
line.Refresh(cdata, variant, ucard.quantity);
|
||||
line.gameObject.SetActive(true);
|
||||
card_lines.Add(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user