예제 #1
0
    private CardVisual CardFactory(CardData data, GameObject cardPrefab)
    {
        GameObject activeCard = Instantiate(cardPrefab) as GameObject;

        CardVisual cardVisual = activeCard.GetComponent <CardVisual>();

        cardVisual.cardData = data;

        allCards.activeCards.Add(cardVisual);
        activeCard.transform.SetParent(GameObject.FindGameObjectWithTag("AllCards").transform, false);

        cardVisual.SetupCardData();

        cardVisual.currentDeck = allCards;

        activeCard.gameObject.name = cardVisual.cardData.cardName;

        return(cardVisual);
    }
예제 #2
0
    private CardVisual CardFactory(CardData data, GameObject cardPrefab)
    {
        GameObject activeCard = Instantiate(cardPrefab) as GameObject;

        CardVisual cardVisual = activeCard.GetComponent <CardVisual>();

        cardVisual.cardData = data;

        //allCards.activeCards.Add(cardVisual);
        activeCard.transform.SetParent(cardContainer, false);
        activeCard.transform.localPosition = new Vector3(-50f, -50f, 0f);

        cardVisual.SetupCardData();

        //cardVisual.currentDeck = allCards;

        activeCard.gameObject.name = cardVisual.cardData.cardName + " [VISUAL TOKEN]";

        return(cardVisual);
    }