标签:style blog io ar color os sp on div
using UnityEngine; using System.Collections; public class Stime : MonoBehaviour { UILabel mTimeLab; void Start () { mTimeLab = this.GetComponent<UILabel>(); } void Update () { updateTime(); } void updateTime() { int hour = System.DateTime.Now.Hour; int min = System.DateTime.Now.Minute; string sHour = hour < 10 ? "0" + hour : hour.ToString(); string sMin = min < 10 ? "0" + min : min.ToString(); mTimeLab.text = sHour + ":" + sMin; } }
标签:style blog io ar color os sp on div
原文地址:http://www.cnblogs.com/heisaijuzhen/p/4126480.html