public void cardRevealead(OriginalCard4 card) { if (firstCard == null) { firstCard = card; } else { secondCard = card; StartCoroutine(matchCheck()); } }
IEnumerator matchCheck() { if (firstCard.getId == secondCard.getId) { score++; gameFinished(); } else { yield return(new WaitForSeconds(0.5f)); firstCard.unreveal(); secondCard.unreveal(); } firstCard = null; secondCard = null; }