예제 #1
0
 /// <summary>
 /// Covers card on table with dropped card. Adds to covered cards list
 /// </summary>
 protected override void AnimateCoverCardBy(CardRoot cardOnTable, CardRoot heldCard)
 {
     //Disable interactions
     cardOnTable.InteractionDisable();
     //Animate
     heldCard.AnimateMoveToTransform(cardOnTable.CoveredCardContainer);
     cardOnTable.CoveredCardContainer.SetAsLastSibling();
 }
예제 #2
0
        public void PickUpCard(CardRoot cardRoot)
        {
            CardsInHand.Add(cardRoot);

            //Enable interactions
            cardRoot.InteractionEnable();

            cardRoot.AnimateMoveToTransform(HandContainer);
        }
예제 #3
0
        /// <summary>
        /// Animate taking cards from talon one by one with slight delay between every card
        /// </summary>
        private IEnumerator AnimateCardsFromTalon(int cardsN)
        {
            for (int i = 0; i < cardsN; i++)
            {
                //Spawn card as child of this trahsform.
                CardRoot cardRootScript = SpawnCardInHand();
                cardRootScript.transform.SetParent(_talonTransform, false);

                //Init animation
                cardRootScript.AnimateMoveToTransform(HandContainer);

                yield return(new WaitForSeconds(0.1f)); //StaticParameters.TalonAnimationDelay);
            }

            //UpdateCardsInHand();
        }
예제 #4
0
        /// <summary>
        /// Animates cover existing card on table
        /// </summary>
        public void AnimateCoverCardOnTable(CardRoot cardOnTable, CardRoot cardHeld)
        {
            cardHeld.AnimateMoveToTransform(cardOnTable.transform);

            LayoutRebuilder.ForceRebuildLayoutImmediate(this.transform as RectTransform);
        }
예제 #5
0
        /// <summary>
        /// Animates drop card on table
        /// </summary>
        public void AnimateDropCardOnTable(CardRoot cardRoot)
        {
            cardRoot.AnimateMoveToTransform(this.transform);

            LayoutRebuilder.ForceRebuildLayoutImmediate(this.transform as RectTransform);
        }