using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Timer : MonoBehaviour { public Text time; public float i_sec; public int i_min; private void Awake() { i_sec = 0; i_min = 0; } private void Update() { i_sec += Time.deltaTime; if(i_sec>=60) { i_min++; i_sec = 0; } time.text = string.Format("{0:D2} : {1:D2}", i_min, (int)i_sec); } }