/// <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(); }
public void PickUpCard(CardRoot cardRoot) { CardsInHand.Add(cardRoot); //Enable interactions cardRoot.InteractionEnable(); cardRoot.AnimateMoveToTransform(HandContainer); }
/// <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(); }
/// <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); }
/// <summary> /// Animates drop card on table /// </summary> public void AnimateDropCardOnTable(CardRoot cardRoot) { cardRoot.AnimateMoveToTransform(this.transform); LayoutRebuilder.ForceRebuildLayoutImmediate(this.transform as RectTransform); }