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