using System;
using System.Threading;
using TMPro;
using UnityEditor.Rendering;
using UnityEngine;

public class LevelScripts : MonoBehaviour
{
    [SerializeField] float clock;
    [SerializeField] TMP_Text gameTime;
    [SerializeField] bool onShift;

    void Start()
    {
        onShift = true;
        clock = 0;
        
    }

    private void Update()
    {
        if (onShift)
        {
            gameTime.text = Convert.ToInt32(clock += Time.deltaTime).ToString();
        }
        else
        {
            EndShift();
        }
    }

    public void EndShift()
    {
        onShift = false;
    }
}
