public float timer = 90f;
void Update()
{
timer -= Time.deltaTime;
if(timer <= 0.0f)
{
Debug.Log("The END");
}
}
using System;
using UnityEngine;
public class TimerTest : MonoBehaviour
{
public float timer = 90;
private DateTime timerEnd;
private void Start()
{
timerEnd = DateTime.Now.AddSeconds(timer);
}
private void Update()
{
TimeSpan delta = timerEnd - DateTime.Now;
Debug.Log(delta.Minutes.ToString("00") + ":" + delta.Seconds.ToString("00"));
if (delta.TotalSeconds <= 0)
{
Debug.Log("The END");
}
}
}