private IEnumerator MoveToCenterOfScreenWaitAndThenMoveToDiscard(AbstractCard card) { var cardPrefab = card.CreateHyperCard(); var leashingBehavior = cardPrefab.GetComponent <CardUiBehaviors>(); leashingBehavior.enabled = false; var movementBehavior = cardPrefab.GetComponent <CardMovementBehaviors>(); var cardSpawnPoint = GameObject.Find("CARD_SPAWN_POINT").transform.localPosition; var discardSpot = GameObject.Find("discard_pile").transform.localPosition; yield return(movementBehavior.MoveToPosition(cardSpawnPoint, cardSpawnPoint, cardPrefab.transform.localEulerAngles, .4f, cardPrefab.transform.localScale, false, null)); yield return(new WaitForSeconds(.5f)); yield return(movementBehavior.MoveToPosition(cardSpawnPoint, discardSpot, cardPrefab.transform.localEulerAngles, .4f, cardPrefab.transform.localScale, true, null)); leashingBehavior.enabled = true; }
internal void CreateCardToHand(AbstractCard abstractCard, AbstractBattleUnit owner = null, QueueingType queueingType = QueueingType.TO_BACK) { Require.NotNull(abstractCard); abstractCard.Owner = owner; QueuedActions.ImmediateAction("CreateCardToHand", () => { BattleRules.MarkCreatedCard(abstractCard, owner); ServiceLocator.GameState().Deck.Hand.Add(abstractCard); ServiceLocator.GetCardAnimationManager().AddHypercardsToHand(new List <Card> { abstractCard.CreateHyperCard() }); }, queueingType); }