This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//試合時間に3秒足すこと | |
private float maxTime = 63f; | |
Timer gameTimer = new Timer (); | |
gameTimer.Start (maxTime, 1f); | |
gameTimer.Elapsed += delegate(float rest) { | |
if(rest == maxTime - 2f){ | |
gameStatusText.text = "GO!!"; | |
} | |
if(rest <= maxTime - 3f){ | |
gameStatusText.text = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Update () { | |
if (isGameStart) { | |
//試合中にPlayer1.zが8fより少なくなったら負け | |
if (GameObject.Find ("Player1").transform.position.z <= 8f) { | |
//ゲーム開始フラグをOFF | |
isGameStart = false; | |
gameTimer.Stop (); | |
Vector3 player1Pos = GameObject.Find ("Player1").transform.position; | |
GameObject.Find ("Player1").transform.DOMove (new Vector3(player1Pos.x, -10f, player1Pos.z), 2f, false); | |
Timer timer = new Timer (); |