using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class timerScript : MonoBehaviour
{
    public float timer = 60;
    
    // Update is called once per frame
    void Update()
    {

        if (FindObjectOfType<GameController>().car_animator.GetCurrentAnimatorStateInfo(0).IsName("GamePHase"))
        {
            if (timer > 0)
            {
                timer -= Time.fixedDeltaTime;
                GetComponent<Text>().text = timer.ToString("F1");
            }

        }
    }
}
