Example #1
0
    private void TimerStateManager()
    {
        if (canStartTimerSubtracting == true && currSessionManager.answerSelected == false)
        {
            RemainingTimeCalculator();

            if (totalTime <= 10f)
            {
                timerWarning = true;
            }

            if (totalTime > fakeAnswerPercentage * timerSlider.maxValue)
            {
                timerText.color = Color.white;

                answerIsFake = true;
                timerWarning = false;
                currSessionManager.canClickAnswer = false;
                // If a button is clicked, the User Randomly answered a question
                // Show that the question was answered too quickly
            }

            if (totalTime <= (fakeAnswerPercentage * timerSlider.maxValue) && totalTime > 0)
            {
                currSessionManager.canClickAnswer = true;
                answerIsFake = false;
            }

            if (totalTime <= 0)
            {
                currSessionManager.CurrQManager();
                currSessionManager.canClickAnswer = false;
                currSessionManager.canClickNext   = true;
                canStartTimerSubtracting          = false;
            }

            // Check if SwiftSwift achievement condition was met
            if (totalTime >= 0.75f * timerSlider.maxValue)
            {
                isSwiftSwift = true;
            }
            else
            {
                isSwiftSwift = false;
            }
            // End of - Check if SwiftSwift achievement condition was met
        }

        if (timerWarning == true && timerStateChanged == false) // Enable Warning
        {
            ChangeTimerText();
            timerStateChanged = true;
        }
        else if (timerWarning == false && timerStateChanged == true) // Disable Warning
        {
            ChangeTimerText();
            timerStateChanged = false;
        }
    }