using UnityEngine;
using System.Collections;
public class countDownTimer : MonoBehaviour {
public UILabel NguiTimeLabel;
public float myTimer = 180.0f;
public int Triggerflag = 1;
void Update () {
if(myTimer > 1.0) {
myTimer -= Time.deltaTime;
int minutes = Mathf.FloorToInt(myTimer / 60F);
int seconds = Mathf.FloorToInt(myTimer - minutes * 60);
string niceTime = string.Format("{0:0}:{1:00}", minutes, seconds);
NguiTimeLabel.text= niceTime;
}
if(myTimer < 1.0) {
if (Triggerflag == 1){
Debug.Log("Game Complete");
Triggerflag = 0;
NguiTimeLabel.text = "time's up";
}
}
}
}