using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
public class t : MonoBehaviour {
public Text tg;
public Text tt;
TimeSpan w ;
public void Start()
{
w = new TimeSpan (0, 2, 1);
Run ();
}
// Use this for initialization
public void Stop()
{
CancelInvoke ();
}
public void Run()
{
w = w.Subtract (new TimeSpan (0, 0, 1));
tg.text = w.Minutes + ":" + w.Seconds;
Invoke("Run",1);
}
// Update is called once per frame
void Update () {
tt.text = DateTime.Now.ToString ("hh/MM/ss");
}
}
沒有留言:
張貼留言