コード例 #1
0
 public void CardRevealed3(MainCard3 card3)
 {
     if (_firstRevealed3 == null)
     {
         _firstRevealed3 = card3;
     }
     else
     {
         _secondRevealed3 = card3;
         StartCoroutine(CheckMatch3());
         _score3++;
         scoreLabel3.text = "Score: " + _score3;
     }
 }
コード例 #2
0
    public IEnumerator CheckMatch3()
    {
        if (_firstRevealed3.id3 == _secondRevealed3.id3)
        {
            countCorrectGuess3++;
            scoreLabel3.text = "Score: " + _score3;

            if (countCorrectGuess3 == gameGuess3)
            {
                Finish3();
                puzzleFinished3.SetActive(true);
            }
        }
        else
        {
            yield return(new WaitForSeconds(0.5f));

            _firstRevealed3.Unreveal3();
            _secondRevealed3.Unreveal3();
        }
        _firstRevealed3  = null;
        _secondRevealed3 = null;
    }