示例
using System;
using UnityEngine;
using UnityEngine.UI;
public class ShowTime : MonoBehaviour
{
public Text time1;
void Update()
{
DateTime nowTime=DateTime.Now.ToLocalTime();
time1.text = nowTime.ToString("yyyy-MM-dd HH:mm:ss");
}
}
上述代码可以实现在Text中显示实时时间。
标签:显示,Text,time1,DateTime,UnityEngine,时间,using,public From: https://www.cnblogs.com/gatran/p/17206116.html