예제 #1
0
    //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());
        }
    }