Skip to content

Instantly share code, notes, and snippets.

Avatar

Hiroshi Take pouhiro1224

  • Midori-ku Yokohama
View GitHub Profile
View gist:5a487a1de2dd675193e3c656ea8f2146
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 ();
@pouhiro1224
pouhiro1224 / gist:a11ee348e3a64327b0ae41172d88a710
Last active Jun 3, 2016
Unityカウントダウンタイマーのサンプルコード
View gist:a11ee348e3a64327b0ae41172d88a710
//試合時間に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 = "";