using UnityEngine;
using System.Collections;

public class TimeCounter : MonoBehaviour {

	public UILabel TimeLabel;
	float timer;

	// Use this for initialization
	void Start () {
		timer = 0.0f;
	}
	
	// Update is called once per frame
	void Update () {
		timer += Time.deltaTime;
		int relevantTimer = (int)(3600 - timer);
		int seconds = (int)(relevantTimer % 60);
		int minutes = (int)((relevantTimer - seconds) / 60);

		TimeLabel.text = minutes.ToString ("D2") + ":" + seconds.ToString ("D2");// string.Format("{0:00}:{1:00}",minutes.ToString(),seconds.ToString());
	}
}
