こんばんは。
timer に問題があります。再生ボタンを押すと、カウントダウンは表示番号3のみです。GUIテキストが機能しないため、3Dテキストを使用したため、GUIテキストではなく3Dテキストを使用しました。
これは COUNTdown.js の私のコードです
#pragma strict
var guiCountDown : TextMesh;
var countMax : int;
private var countDown : int;
function Start(){
guiCountDown.active = true;
GameStart();
}
function GameStart(){
var car = gameObject.Find("Car");
var drivingScript = car.GetComponent("Car");
drivingScript.active = false;
var timer = GetComponent("Timer");
timer.active = false;
for(countDown = countMax; countDown >= 0; countDown--){
Debug.Log("Count: " + countDown);
if(countDown == 0){
guiCountDown.text = "GO!";
}
else
guiCountDown.text = countDown.ToString();
yield WaitForSeconds(1);
}
guiCountDown.active = false;
drivingScript.active = true;
timer.active = true;
}
これは TIMEr.js の私のコードです
#pragma strict
var pastTime : float;
var guiTime : TextMesh;
function Update (){
pastTime += Time.deltaTime;
guiTime.text = pastTime.ToString ();
}
みんな助けて。