Example #1
0
    IEnumerator DrawCard(int amount)
    {
        for (int i = 0; i < amount; ++i)
        {
            GameObject go = deck.DrawCard();
            if (!go)
            {
                deck.ResetDeck();
                go = deck.DrawCard();
            }
            yield return(new WaitForSeconds(0.5f));

            if (handCards.Count < handSizeMax)
            {
                handSize++;
                handCards.Add(go);
                go.transform.position = handCardPos[handCards.Count - 1];
                go.SetActive(true);
                CombatCard cc = go.GetComponent <CombatCard>();
                cc.hand      = this;
                cc.handIndex = handCards.Count - 1;
            }
            else
            {
                grave.AddtoGrave(go);
            }
            yield return(new WaitForSeconds(0.1f));
        }
        yield break;
    }