public CardBehaviour CreateCardIn(EncounterCardWrapper card, SlotType slot = SlotType.Nowhere) { GameObject cardGo = Instantiate(DefaultResources.GetPrefab(DefaultResources.PrefabType.EncounterCard)); cardGo.GetComponent <EncounterCardVisual>().Init(card, true); return(CardCreation(cardGo, slot)); }
private void PlayerClickedOnDeckRPC(int playerId) { if (GameStateMachine.Instance.CanClickEncounterDeck) { EncounterCardWrapper card = BoardData.Instance.GetNextEncounterCard(); BoardData.Instance.CurrentEncounter = card.CardId; ClientController.Instance.photonView.RPC("DeckClicked", RpcTarget.All, new object[] { card.CardId, card.Guid }); GameStateMachine.Instance.CanClickEncounterDeck = false; } }
private void DeckClicked(int cardId, string cardGuid) { EncounterCardWrapper wrapper = new EncounterCardWrapper((EncounterCard)DefaultResources.GetCardById(cardId, DefaultResources.CardType.Encounter), cardGuid); CardBehaviour cardBehaviour = CardsLayoutManager.Instance.CreateCardIn(wrapper, CardsLayoutManager.SlotType.EncounterDeck); CardsLayoutManager.Instance.MoveCardTo(cardBehaviour, CardsLayoutManager.SlotType.CurrentEncounter, () => { cardBehaviour.GetComponent <EncounterCardVisual>().ShowVariants(); }); }
public EncounterCardWrapper GetNextEncounterCard() { EncounterCardWrapper card = null; if (_encounterDeck.Count > 0) { card = _encounterDeck.Dequeue(); } if (_encounterDeck.Count == 0) { Debug.LogWarning("NO cards in deck"); } return(card); }
public void Init(EncounterCardWrapper card, bool show) { base.Init(card.Card, card.Guid); }