예제 #1
0
    void Start()
    {
        dataController = FindObjectOfType <Data_Controller>();                                                                  // Store a reference to the DataController so we can request the data we need for this round

        currentRoundData = dataController.GetCurrentRoundData();                                                                // Ask the DataController for the data for the current round. At the moment, we only have one round - but we could extend this
        questionPool     = currentRoundData._questions;                                                                         // Take a copy of the questions so we could shuffle the pool or drop questions from it without affecting the original RoundData object

        timeRemaining = currentRoundData._timeLimitInSeconds;                                                                   // Set the time limit for this round based on the RoundData object
        UpdateTimeRemainingDisplay();
        playerScore   = 0;
        questionIndex = 0;

        ShowQuestion();
        isRoundActive = true;
    }