using System;
using UnityEngine.UI;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Timer : MonoBehaviour
{
public GameObject Winer;
public float miliSecond;
public float second;
public float minute;
public Text text;
private void FixedUpdate()
{
miliSecond += 0.02f;
if(miliSecond>=1)
{
second++;
miliSecond = 0;
}
if(second>=60)
{
minute++;
second = 0;
}
if (minute >= 45)
{
Winer.SetActive(true);
}
if (minute >= 45 && second>=3)
{
SceneManager.LoadScene("MainMenu");
}
text.text = $"{minute} :{second}";
}
}