Exemplo n.º 1
0
 public void RepositionDisplayingCards(CardAnimator cardAnimator)
 {
     NumberOfReleasedCards = 0;
     foreach (Card card in ReleasedCards)
     {
         NumberOfReleasedCards++;
         cardAnimator.AddCardAnimation(card, position);
     }
 }
Exemplo n.º 2
0
 public void RepositionDisplayingCards(CardAnimator cardAnimator)
 {
     Debug.Log("uu");
     NumberOfDisplayingCards = 0;
     foreach (Card card in DisplayingCards)
     {
         NumberOfDisplayingCards++;
         cardAnimator.AddCardAnimation(card, NextCardPosition());
     }
 }
Exemplo n.º 3
0
        public void ReceiveBook(Ranks rank, CardAnimator cardAnimator)
        {
            Vector2     targetPosition          = NextBookPosition();
            List <Card> displayingCardsToRemove = new List <Card>();

            foreach (Card card in DisplayingCards)
            {
                if (card.Rank == rank)
                {
                    card.SetFaceUp(true);
                    float randomRotation = UnityEngine.Random.Range(-1 * Constants.BOOK_MAX_RANDOM_ROTATION, Constants.BOOK_MAX_RANDOM_ROTATION);
                    cardAnimator.AddCardAnimation(card, targetPosition, Quaternion.Euler(Vector3.forward * randomRotation));
                    displayingCardsToRemove.Add(card);
                }
            }

            DisplayingCards.RemoveAll(card => displayingCardsToRemove.Contains(card));
            RepositionDisplayingCards(cardAnimator);
            NumberOfBooks++;
        }