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); }
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); }