public IEnumerator DealCardToHand(Action <GameCard> cardAnimComplete, bool faceUp = true) { GameCard dealtCard = deckView.DrawCard(); switch (handOwner) { case HandType.Player: dealtCard.transform.positionTo(.25f, transform.position + new Vector3(10 * gameCards.Count, 0, 0)); break; case HandType.Opponent: Vector3 vec = new Vector3(0, 180, 0); if (faceUp == false) { dealtCard.transform.localRotation = Quaternion.Euler(vec); } dealtCard.transform.positionTo(.25f, transform.position + new Vector3(10 * gameCards.Count, 0, 0)); break; } yield return(new WaitForSeconds(.25f)); cardAnimComplete(dealtCard); HandTotalValue += dealtCard.Model.GetBlackJackCardValue(); Debug.Log(this.handOwner.ToString() + " " + HandTotalValue); }
public IEnumerator DealCardToHand(Action <GameCard> cardAnimComplete) { GameCard dealtCard = deckView.DrawCard(); switch (handOwner) { case HandType.Player: dealtCard.transform.positionTo(.25f, transform.position + new Vector3(10 * gameCards.Count, 0, 0)); break; case HandType.Opponent: Vector3 vec = new Vector3(0, 180, 0); dealtCard.transform.localRotation = Quaternion.Euler(vec); dealtCard.transform.positionTo(.25f, transform.position + new Vector3(10 * gameCards.Count, 0, 0)); break; } yield return(new WaitForSeconds(.25f)); cardAnimComplete(dealtCard); }