Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        injector = this.GetComponent <QuizInjector> ();

        idLevel = PlayerPrefs.GetInt("idLevel");
        PlayerPrefs.SetInt("questionsSize", questions.Count);
        idQuestion = 0;
        ques       = questions.Count;

        Question.text = questions[idQuestion];
        AnswerA.text  = alternativeA[idQuestion];
        AnswerB.text  = alternativeB[idQuestion];
        AnswerC.text  = alternativeC[idQuestion];
        AnswerD.text  = alternativeD[idQuestion];

        TestHideAnswer(AnswerA);
        TestHideAnswer(AnswerB);
        TestHideAnswer(AnswerC);
        TestHideAnswer(AnswerD);

        var quiz = injector.quizes[idLevel - 1 < 0 ? 0 : idLevel - 1];

        infoAnswer.text = "Quiz " + quiz.name + ": " + correct.ToString() + " de " + ques.ToString() + " acertos";

        DontDestroyOnLoad(this);
//		ad.RequestInterstitial ();
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        idLevel             = 0;
        txtselectLevel.text = Level [idLevel];
        txtinfoLevel.text   = "Correct answers X of X questions";
        infoLevel.SetActive(false);
        star1.SetActive(false);
        star2.SetActive(false);
        star3.SetActive(false);
        Play.interactable = false;

        injector = this.GetComponent <QuizInjector>();
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        injector = this.GetComponent <QuizInjector> ();
        qea      = this.GetComponent <AllAnswers> ();
        var idLevel = PlayerPrefs.GetInt("idLevel");

        var quiz = injector.quizes [idLevel - 1 < 0 ? 0 : idLevel - 1];

        foreach (var question in quiz.questions)
        {
            qea.questions.Add(question.text);
            qea.alternativeA.Add(question.answerA);
            qea.alternativeB.Add(question.answerB);
            qea.alternativeC.Add(question.answerC);
            qea.alternativeD.Add(question.answerD);
            qea.corrects.Add(question.textFromCorrectAnswer());
        }
    }