Ejemplo n.º 1
0
    public void AnswerQuestion(int choice)
    {
        // Log the question
        Debug.Log("Answer to question " + currentQuestion.id + ": " + choice + " -> " + currentQuestion.choices[choice].text);
        log.Info("Answer to question " + currentQuestion.id + ": " + choice + " -> " + currentQuestion.choices[choice].text);

        // Hide the canvas
        this.GetComponent <FadingElementUI>().fadeOutCanvas();

        // Answer the question
        if (currentQuestion != null)
        {
            currentQuestion.ExecuteChoice(choice);
            //scenarioController.AnswerQuestion(currentQuestion.id, choice);

            // Add the question to the previous questions
            previousQuestions.Push(currentQuestion);
            currentQuestion = null;
        }

        // Unblock the camera
        cameraControl.UnblockPlayerControls();

        // Resume the game
        if (timeController != null)
        {
            timeController.PauseGame(false);
            timeController.BlockPauseButton(false);
        }
    }