void Update() { Vector3 pos = this.gameObject.transform.position; if (Input.GetKey(KeyCode.LeftArrow)) { if (-5.2 <= pos.x && pos.x <= -5.0) //Perfect範囲 { hantei.Perfect = true; hantei.Heal = true; hantei.Appearance(); Destroy(gameObject); } if (-5.4 <= pos.x && pos.x < -5.2 || //Good範囲 -5.0 < pos.x && pos.x <= -4.8) { hantei.Good = true; hantei.Appearance(); Destroy(gameObject); } if (pos.x < -5.4) //Bad範囲 { hantei.Bad = true; hantei.Appearance(); Destroy(gameObject); One = false; } } if (pos.x < -5.4) //グレーに変わるタイミング { hantei.Out = true; hantei.Appearance(); Destroy(gameObject); } }
void Update() { Vector3 pos = this.gameObject.transform.position; if (Input.GetKey(KeyCode.RightArrow)) { if (-4.96 <= pos.x && pos.x <= -4.76) //Perfect範囲 { hantei.Perfect = true; hantei.Appearance(); Destroy(gameObject); } if (-5.16 <= pos.x && pos.x < -4.96 || //Good範囲 -4.76 < pos.x && pos.x <= -4.56) { hantei.Good = true; hantei.Appearance(); Destroy(gameObject); } if (pos.x < -5.16) //Bad範囲 { hantei.Bad = true; hantei.Appearance(); Destroy(gameObject); One = false; } } if (pos.x < -5.16) //グレーに変わるタイミング { hantei.Out = true; hantei.Appearance(); Destroy(gameObject); } }
void Update() { Vector3 pos = this.gameObject.transform.position; //Miss範囲 if (pos.x < -7) { if (One) { Instantiate(deviate); One = false; hantei.Out = true; hantei.Appearance(); } } // X = -8 を過ぎたらオブジェクトを削除 if (transform.position.x < -8) { Destroy(gameObject); } }