public void CheckCard(MemoryCard _card) { if (answers.Count >= numAnswers) { return; } if (answers.Count < numAnswers) { answers.Add(_card); RotateErrors += _card.Rotate; } if (answers.Count >= numAnswers) { if (LockCards != null) { LockCards(); } bool notEqual = answers.Any(o => o.id != answers[0].id); if (!notEqual) { for (int i = 0; i < answers.Count; i++) { MemoryCard card = answers[i].GetComponent <MemoryCard>(); card.RemoveEvents(); } correctAnswers++; tempScore += defaultScoreCorrect; int pID = 0; if (_card.cardFace.name.Contains("COBALT")) { pID = 1; } else if (_card.cardFace.name.Contains("CRUZE")) { pID = 2; } else if (_card.cardFace.name.Contains("EQUINOX")) { pID = 3; } else if (_card.cardFace.name.Contains("ONIX")) { pID = 4; } else if (_card.cardFace.name.Contains("PRISMA")) { pID = 5; } else if (_card.cardFace.name.Contains("SPIN")) { pID = 6; } OpenPopup(pID); if (OnScore != null) { OnScore(correctAnswers); } ClearAnswers(); } else { tempScore += defaultScoreError; Invoke("ErrorFeedback", rotationDuration + 0.5f); } if (_sfxController != null) { if (!notEqual) { Debug.Log("SfxCerto"); _sfxController.PlaySound("Right"); } else { Debug.Log("SfxErro"); _sfxController.PlaySound("Wrong"); } } //if(ScoreToUpdate != null) //ScoreToUpdate(tempScore.ToString()); } if (correctAnswers >= qntMatches) { gameWon = true; Invoke("EndGame", 2f); } }