Beispiel #1
0
 /// <summary>
 /// Invoked whenever a card is played and it wan't canceled.
 /// Removes that card from its owner's hand and reduces their gold count by <see cref="CardInfo.Cost"/>.
 /// Card owner draws a new card from their deck.
 /// </summary>
 /// <param name="message"></param>
 private void OnCardPlayed(MatchMessageCardPlayed message)
 {
     Debug.Log("playing " + message.Card.cardType);
     if (message.PlayerId == NakamaSessionManager.Instance.Session.UserId)
     {
         _localHandPanel.ResolveCardPlay(message);
         _localHandPanel.DrawCard(message.NewCard, message.CardSlotIndex);
         _localGold.ChangeGoldCount(-message.Card.GetCardInfo().Cost);
     }
     else if (MatchCommunicationManager.Instance.IsHost == true)
     {
         _opponentGold.ChangeGoldCount(-message.Card.GetCardInfo().Cost);
     }
 }