Beispiel #1
0
 public void cardRevealead(OriginalCard card)
 {
     if (firstCard == null)
     {
         firstCard = card;
     }
     else
     {
         secondCard = card;
         StartCoroutine(matchCheck());
     }
 }
Beispiel #2
0
    IEnumerator matchCheck()
    {
        if (firstCard.getId == secondCard.getId)
        {
            score++;
            gameFinished();
        }
        else
        {
            yield return(new WaitForSeconds(0.5f));

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

        firstCard  = null;
        secondCard = null;
    }