void AddCard(int cardType)
    {
        float      co       = cardOffset * cardCount;
        Vector3    position = start + new Vector3(co, 0f);
        GameObject cardCopy = (GameObject)Instantiate(cardPrefab);

        cardCopy.transform.localScale = GetComponent <Transform>().localScale;
        cardCopy.transform.position   = position;


        LootCardModel cardModel = cardCopy.GetComponent <LootCardModel>();

        cardModel.cardType = cardType;
        cardModel.ToggleFace(faceUp);
        livePile.Add(cardCopy);

        SpriteRenderer spriteRenderer = cardCopy.GetComponent <SpriteRenderer>();

        if (showReverseCardOrder)
        {
            spriteRenderer.sortingOrder = deck.CardCount() - 1 - cardCount;
        }
        else
        {
            spriteRenderer.sortingOrder = cardCount;
        }
        cardCount++;
    }
Exemple #2
0
 public bool AdventureComplete()
 {
     return(mainDeck.CardCount() == 0);
 }