private void AddDeckToDock(DeckStruct ds) { Transform deck = Lean.Pool.LeanPool.Spawn(DeckPrefab).transform; deck.transform.SetParent(Dock); deck.transform.localScale = Vector3.one; deck.SetAsFirstSibling(); deck.GetComponent <DeckButton> ().Init(ds); AddDeckButton.SetActive(Dock.childCount != 9); }
public void CreateDeck() { DeckStruct newDs = new DeckStruct("NewDeck", new List <string>()); LobbyPlayerIdentity.Instance.player.Decks.Add(newDs); Transform deck = Lean.Pool.LeanPool.Spawn(DeckPrefab).transform; deck.transform.SetParent(Dock); deck.transform.localScale = Vector3.one; deck.GetComponent <DeckButton> ().Init(newDs); deck.SetAsFirstSibling(); deck.SetSiblingIndex(deck.GetSiblingIndex() - 1); AddDeckButton.SetActive(Dock.childCount != 9); LobbyMenu.Instance.EditDeck(newDs); }
public void Init(DeckStruct deck) { foreach (LibraryCardPanel lcp in cardsPanels) { Lean.Pool.LeanPool.Despawn(lcp.gameObject); } cardsPanels.Clear(); foreach (string card in LobbyPlayerIdentity.Instance.player.AllCards) { AddCard(DefaultResourcesManager.GetCardById(card)); } foreach (string c in deck.Cards) { RemoveCard(c); } }
public void Init(DeckStruct ds) { cardStruct = ds; DeckName.text = ds.DeckName; Sprite[] winSprites = ds.GetWinCardsSprires(); for (int i = 0; i < 3; i++) { if (winSprites [i]) { WinCardsImages [i].enabled = true; WinCardsImages[i].sprite = winSprites[i]; } else { WinCardsImages [i].enabled = false; } } }
public void Init(DeckStruct ds) { foreach (DeckCardPanel lcp in cardPanels) { Lean.Pool.LeanPool.Despawn(lcp.gameObject); } cardPanels.Clear(); deck = ds; DeckName.text = ds.DeckName; foreach (DeckCardPanel dcp in cardPanels) { Lean.Pool.LeanPool.Despawn(dcp.gameObject); } foreach (string c in ds.Cards) { AddCard(c); } }
private void InitPlayerDefault() { player.PlayerName = DefaultResourcesManager.GetRandomName(); player.PlayerColor = DefaultResourcesManager.GetRandomColor(); player.PlayerAvatarId = DefaultResourcesManager.GetRandomAvatar(); player.Decks = new List <DeckStruct>(); DeckStruct startingDeck = DefaultResourcesManager.StartingDeck; startingDeck = new DeckStruct(startingDeck.DeckName, startingDeck.Cards); player.Decks.Add(startingDeck); player.CurrentDeck = startingDeck; for (int i = 0; i < 3; i++) { foreach (Card c in DefaultResourcesManager.AllCards) { player.AllCards.Add(c.name); } } }
public void EditDeck(DeckStruct ds) { PlayerPanel.SetActive(false); DeckPanel.SetActive(true); DeckPanel.GetComponent <DeckEditPanel> ().Edit(ds); }
public void Edit(DeckStruct ds) { editingDeck = ds; deckView.Init(ds); cardsView.Init(ds); }