Пример #1
0
    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));
    }
Пример #2
0
 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;
     }
 }
Пример #3
0
    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();
        });
    }
Пример #4
0
    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);
    }
Пример #5
0
 public void Init(EncounterCardWrapper card, bool show)
 {
     base.Init(card.Card, card.Guid);
 }