Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (timerOn)
        {
            timeRemaining -= Time.deltaTime;
            t              = timeRemaining;
            minutes        = ((int)t / 60).ToString();
            seconds        = (t % 60).ToString("f0");

            if (timeRemaining < 0)
            {
                over.timerOver();
                timeOver = true;
            }
            else
            {
                timerText.text = minutes + " : " + seconds;
            }
        }
    }