我有以下代码,我想添加 miliSeconds var,以便显示如下内容:
分 : 秒 : miliSeconds
2:35:98
Time.time 是从应用程序开始经过的时间,每帧都会调用更新函数。
var startTime:float;
var timeRemaining:float;
var minutes:int;
var seconds:int;
var miliSeconds:int;
var timeStr:String;
function Start () {
startTime = 130.0;
}
function Update () {
timeRemaining = startTime - Time.time;
minutes = timeRemaining / 60;
seconds = timeRemaining % 60;
//miliSeconds = ?
timeStr = minutes.ToString()+":"+seconds.ToString("D2");
guiText.text = timeStr;
}