/// <summary> /// Draws the passed card onto the ui game object. /// </summary> public void DrawCard(Card card) { if (_removeCoroutine != null) { StopCoroutine(_removeCoroutine); } if (card == null) { throw new ArgumentException("Card can't be null."); } TextVarientCollection texts = card.GetTextVarientCollection(); if (_text.text == texts.text) { return; } _text.text = string.Empty; if (card.Image == null) { return; } if (_textCorotutine != null) { StopCoroutine(_textCorotutine); } _textCorotutine = StartCoroutine(AnimateTextIn(texts.text)); }
/// <summary> /// Draws the passed card onto the ui game object. /// </summary> public void DrawCard(Card card) { if (card == null) { throw new ArgumentException("Card can't be null."); } _currentCard = card; TextVarientCollection texts = card.GetTextVarientCollection(); _cardText = texts; _text.text = card.Image == null ? texts.text : string.Empty; _cardImage.color = new Color(1, 1, 1, card.Image != null ? 1 : 0); _cardImage.sprite = card.Image; }