//Pulls a card from the deck and moves it to the dealer's hand //both physically and in the backend, without flipping it over. private IEnumerator DealCardToSelfFaceDown() { GameObject card = deck.DealCard(); cardScript script = card.GetComponent <cardScript>(); anim.Play("godBossDealToSelfAnimation"); Vector3 cardPos = dealerHandPosition; cardPos.z -= hand.Count * cardSpacing; cardPos.y += hand.Count * 0.1f; yield return(StartCoroutine(script.MoveCard(cardPos))); AddCardToHand(card); }
//Pulls a card from the deck and moves it to the dealer's hand //both physically and in the backend. private IEnumerator DealCardToSelf() { GameObject card = deck.DealCard(); cardScript script = card.GetComponent <cardScript>(); anim.CrossFade("godBossDealToSelfAnimation"); StartCoroutine(script.Flip()); Vector3 cardPos = dealerHandPosition; cardPos.z -= hand.Count * cardSpacing; cardPos.y += hand.Count * 0.1f;// + 4.0f; yield return(StartCoroutine(script.MoveCard(cardPos))); AddCardToHand(card); if (options.GetShowOnUIToggle()) { UI.SetDealerHandValueText(GetHandValue()); } }
//Pulls a card from the deck and moves it to the player's hand //both physically and in the backend. public IEnumerator DealCardToPlayer() { GameObject card = deck.DealCard(); cardScript script = card.GetComponent <cardScript>(); anim.CrossFade("godBossDealToPlayerAnimation"); Vector3 cardPos = playerHandPosition; cardPos.z -= player.GetHandSize() * cardSpacing; cardPos.y += player.GetHandSize() * 0.1f; StartCoroutine(script.Flip()); yield return(StartCoroutine(script.MoveCard(cardPos))); player.addToHand(card); if (options.GetShowOnUIToggle()) { UI.SetPlayerHandValueText(player.GetHandValue()); } }