Example #1
0
 public void revealedCard(CircleCard card)
 {
     if (firstCard == null)
     {
         firstCard = card;
     }
     else
     {
         secondCard = card;
         StartCoroutine(checkMatch());
     }
 }
Example #2
0
    private IEnumerator checkMatch()
    {
        if (firstCard.id == secondCard.id)
        {
            score++;
            label.text = "Score: " + score;
        }
        else
        {
            yield return(new WaitForSeconds(.8f));

            firstCard.unreveal();
            secondCard.unreveal();
        }

        firstCard  = null;
        secondCard = null;
        checkForWin();
    }