private void NextQuestion() { ScenarioQuestion nextQuestion = null; try { nextQuestion = DatabaseHandler.FiguresWithQuestionsAndAnswers[currentFigure].Keys.SkipWhile(k => k != currentQuestion).Skip(1).First(); Debug.Log(currentFigure.Id); } catch { } if (nextQuestion != null) { currentQuestion = nextQuestion; currentAnswers = GetAnswers(currentQuestion); translator.SetQuestionText(currentQuestion.Question_Text); translator.ShowAnswers(currentAnswers.Count, currentAnswers); } else { try { currentFigure = DatabaseHandler.FiguresWithQuestionsAndAnswers.Keys.SkipWhile(k => k != currentFigure).Skip(1).First(); } catch { currentFigure = null; } if (currentFigure == null) { ShowResults(); } else { panelHandler.OpenPlayPopUp(); Destroy(GameObject.FindGameObjectWithTag("ARContent")); arTap.contentToPlace = GetNextFigureById(currentFigure.Figure_Id); arTap.isPlaced = false; ARInteraction.AREnabled = true; questionPanel.SetActive(false); currentQuestion = DatabaseHandler.FiguresWithQuestionsAndAnswers[currentFigure].Keys.First(); } } }