コード例 #1
0
ファイル: GameManager.cs プロジェクト: artemy0/Quiz
    private void DetermineQuestion()
    {
        //Question generation
        _currentQuestion = QuestionsManager.GenerateUniqueQuestion();

        //UI display
        QuestionText.text = _currentQuestion.question;

        List <string> copyAnswers = new List <string>(_currentQuestion.answers);

        for (int i = 0; i < _currentQuestion.answers.Length; i++)
        {
            int randAnswerIndex = Random.Range(0, copyAnswers.Count);

            AnswersText[i].text = copyAnswers[randAnswerIndex]; //filling UI items

            copyAnswers.RemoveAt(randAnswerIndex);
        }
    }