Esempio n. 1
0
    public void AnswerCurrentQuestion()
    {
        Toggle selectedToggle = _questionnaireToggleGroup.ActiveToggles().FirstOrDefault();

        if (selectedToggle)
        {
            //set question answer
            _questions[_currentQuestionIndex].AnswerQuestion(selectedToggle.gameObject.GetComponent <QuestionnaireToggle>().ToggleIndex);

            //skip to next question if an answer is selected
            if (_currentQuestionIndex + 1 < _questions.Count)
            {
                DisplayNextQuestion();
            }
            else
            {
                //the questionnaire is finished, start the game after processing the answers
                DetermineInitialGameDifficulty();
                LoadLevel.LoadSceneWithIndex(1);
            }
        }
    }