Ejemplo n.º 1
0
 void OnCardGained(CardData card, bool isPlayer)
 {
     if (isPlayer)
     {
         if (card.isAutoTrigger)
         {
             if (ActionManager.OnCardDeployed != null)
             {
                 ActionManager.OnCardDeployed(card, isPlayer);
             }
         }
         else
         {
             CardsOwned cardOwned = playerOwnedCards.Find(x => x.card == card);
             if (cardOwned == null)
             {
                 playerOwnedCards.Add(new CardsOwned(card, 1));
             }
             else
             {
                 cardOwned.UpdateCardCount(1);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void Init(CardsOwned card)
 {
     ownedData        = card;
     currentCardData  = card.card;
     count.text       = card.cardCount.ToString();
     CardName.text    = card.card.cardName;
     cardImage.sprite = Resources.Load <Sprite>("CardSprites/" + card.card.cardImage);
 }
Ejemplo n.º 3
0
 public bool RemoveIndex(byte index)
 {
     if (CardsOwned.Contains(index))
     {
         int slot = (int)GetSlot(index);
         Renderers[slot].Index = CardIndex.EMPTY_SLOT;
         Renderers[slot].RefreshCardImage();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 void OnCardDeployed(CardData card, bool isPlayer)
 {
     if (isPlayer)
     {
         CardsOwned cardOwned = playerOwnedCards.Find(x => x.card == card);
         if (cardOwned != null)
         {
             cardOwned.UpdateCardCount(-1);
         }
     }
 }