コード例 #1
0
    public CardInfo CreateCard(int cardId)
    {
        Card card = CardManagerData.allCards.Find(c => c.id == cardId);

        Quaternion deckQuat = Quaternion.identity;

        deckQuat.eulerAngles = new Vector3(0, 90, 180);

        GameObject cardGO = Instantiate(cardPrefab, deckPos, deckQuat);

        cardGO.name = card.cardType.ToString().ToLower() + "Card (" + card.name + ")";

        CardInfo cardInfo = cardGO.GetComponent <CardInfo>();

        cardInfo.BuildCard(card);

        return(cardInfo);
    }
コード例 #2
0
    public CardInfo CreateCard(HidenCard.DeckType deckType)
    {
        HidenCard hidenCard = new HidenCard();;

        hidenCard.deckType = deckType;

        Quaternion deckQuat = Quaternion.identity;

        deckQuat.eulerAngles = new Vector3(0, 90, 180);

        GameObject cardGO = Instantiate(cardPrefab, deckPos, deckQuat);

        cardGO.name = hidenCard.deckType.ToString().ToLower() + " card";

        CardInfo cardInfo = cardGO.GetComponent <CardInfo>();

        cardInfo.BuildCard(hidenCard);

        return(cardInfo);
    }