Ejemplo n.º 1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (isPaused == false)
        {
            countDownTimer();
            if (roundTimeHasStarted && !timerIsOver)
            {
                roundTimeLeft -= Time.deltaTime;
                mainTimer.updateMainTimerText(roundTimeLeft);

                actionTimeLeft -= Time.deltaTime;

                if (actionTimeLeft <= 0)
                {
                    controller.roundOver();
                }

                if (roundTimeLeft <= 0)
                {
                    controller.GameOver();
                    timerIsOver = true;
                }
            }
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (isPaused == false)
        {
            if (!countDownTimerIsOver)
            {
                countDownTimer();
            }

            if (roundTimeHasStarted && !timerIsOver)
            {
                roundTimeLeft -= Time.deltaTime;
                totalTime     += Time.deltaTime;
                mainTimerText.updateMainTimerText(roundTimeLeft);
                survivalModeTotalTimerText.updateTotalTimerText(totalTime);

                if (roundTimeLeft <= 0)
                {
                    controller.GameOver();
                    timerIsOver = true;
                }
            }
        }
    }