public Sprite GetSprite(GameVariables.CardType cardValue, GameVariables.SuitType suitType) { if (suitType == GameVariables.SuitType.Joker || cardValue == GameVariables.CardType.Joker) { return(cardSprites[52]); } int _index = ((int)suitType - 1) * SUIT_LENGTH + (int)cardValue - 1; return(cardSprites[_index]); }
internal void Init(GameVariables.CardType cardValue, GameVariables.SuitType suitType) { this.cardValue = cardValue; this.suitType = suitType; cardImage.sprite = CardController.GetInstance.GetSprite(cardValue, suitType); wildCardJ.SetActive(GamePlayManager.GetInstance.wildCard.suitValue == suitType && GamePlayManager.GetInstance.wildCard.cardValue == cardValue); if (cardValue == GameVariables.CardType.Ace) { cardValueIndex = 14; } else { cardValueIndex = (int)cardValue; } }
internal void SetDetail(GameVariables.CardType cardValue, GameVariables.SuitType suitType) { image.sprite = CardController.GetInstance.GetSprite(cardValue, suitType); wildCardJ.SetActive(GamePlayManager.GetInstance.wildCard.suitValue == suitType && GamePlayManager.GetInstance.wildCard.cardValue == cardValue); }