示例#1
0
    void InitDeck()
    {
        // 첫 장을 뽑아서 usedCardList에 옮긴다
        usedCardList.Add(deck[deck.Count - 1]);
        Debug.Log(deck[deck.Count - 1].gameObject.name);
        deck.RemoveAt(deck.Count - 1);
        usedCardList[0].gameObject.transform.position = usedCardPos;
        usedCardList[0].GetComponent <Card>().SetCardOwner(CARD_OWNER.USED);
        currType    = usedCardList[0].GetComponent <Card>().GetCardType();
        currCardNum = usedCardList[0].GetComponent <Card>().GetCardNum();
        currCardDam = 0;
        SetCurrentTypeText();
        SetTotalDamText();

        for (int i = 0; i < 5; i++)
        {
            if (player)
            {
                player.AddCard(deck[deck.Count - 1]);
                //deck[deck.Count - 1].GetComponent<Card>().SetCardOwner(CARD_OWNER.PLAYER);
                deck[deck.Count - 1].transform.parent = player.gameObject.transform;
                Debug.Log(deck[deck.Count - 1].gameObject.name + " " + deck[deck.Count - 1].GetComponent <Card>().GetCardOwner());
                deck.RemoveAt(deck.Count - 1);
            }
            if (enemy)
            {
                enemy.AddCard(deck[deck.Count - 1]);
                //deck[deck.Count - 1].GetComponent<Card>().SetCardOwner(CARD_OWNER.ENEMY);
                deck[deck.Count - 1].transform.parent = enemy.gameObject.transform;
                Debug.Log(deck[deck.Count - 1].gameObject.name + " " + deck[deck.Count - 1].GetComponent <Card>().GetCardOwner());
                deck.RemoveAt(deck.Count - 1);
            }
        }
        SetCntText();
    }