public void AddCardText(Card card, Vector3 textPos, Vector3 textScale, int direction) { CardText text = Instantiate(_textClone); text.SetText(CardIndexToString(((int)card.GetCardIndex() / 10))); text.SetParent(card.gameObject.transform); text.SetScale(textScale); text.SetPosition(textPos * direction); text.SetFontSize(40); if (card.GetShapeIndex() == ShapeTag.Club || card.GetShapeIndex() == ShapeTag.Spade) { text.SetColor(Color.black); } else { text.SetColor(Color.red); } if (direction > 0) { text.SetReverse(); } text.SetFont(TextFont); card.Texts.Add(text); }
public void InitizlizeText(GameObject parentObject, string str) { CardText text = parentObject.AddComponent <CardText>(); text.SetText(str); }