// Update is called once per frame void Update() { state_info_ = game_system.GetComponent <Game_system>().state; if (state_info_ == Game_system.state_info.Playing) { if (Input.GetKey(KeyCode.C)) { if (!push_key_flag) { if (!pouse_flag) { Time.timeScale = 0.0f; pouse_flag = true; } else { Time.timeScale = 1.0f; pouse_flag = false; } } push_key_flag = true; } else { push_key_flag = false; } } }
// Update is called once per frame void Update() { state_info_ = game_system.GetComponent <Game_system>().state; if (state_info_ != Game_system.state_info.Playing) { audio.Stop(); } }
// Update is called once per frame void Update() { state_info_ = game_system.GetComponent <Game_system>().state; if (state_info_ == Game_system.state_info.Gameover) { this.GetComponent <Text>().text = ""; gameover1.GetComponent <Text>().text = "GAME OVER"; gameover2.GetComponent <Text>().text = "Score " + score.ToString(); gameover3.GetComponent <Text>().text = "Please push Z key"; } else if (state_info_ == Game_system.state_info.Playing) { this.GetComponent <Text>().text = "Score " + score.ToString(); } else if (state_info_ == Game_system.state_info.Pouse) { } }
// Update is called once per frame void Update() { state_info_ = game_system.GetComponent <Game_system>().state; if (!save_flag && state_info_ == Game_system.state_info.Gameover) { new_score = scoretext.GetComponent <Score_texts>().score; for (int i = 0; i < 10; i++) { high_score[i] = PlayerPrefs.GetInt(high_score_rank[i]); if (new_score > high_score[i]) { storage = high_score[i]; high_score[i] = new_score; new_score = storage; PlayerPrefs.SetInt(high_score_rank[i], high_score[i]); } save_flag = true; } } }
// Update is called once per frame void Update() { state_info_ = game_system.GetComponent <Game_system>().state; //rank = game_system.GetComponent<Game_system>().rank; if (count > 10 && rank < 5.0f) { rank += 0.5f; count = 0; } if (state_info_ == Game_system.state_info.Playing) { measure_time += Time.deltaTime; if (measure_time > create_time - rank) { vec = this.transform.position; Instantiate(boxunity, vec, Quaternion.Euler(0, 0, 0)); measure_time = 0.0f; count++; } } }
// Update is called once per frame void Update() { if (Time.timeScale > 0) { state_info_ = game_system.GetComponent <Game_system>().state; if (state_info_ == Game_system.state_info.Playing) { transform.position += gameobject.transform.position - before_position; before_position = gameobject.transform.position; if (Input.GetKey(KeyCode.S)) { transform.RotateAround(gameobject.transform.position, Vector3.up, rotate_speed * Time.deltaTime); } if (Input.GetKey(KeyCode.A)) { transform.RotateAround(gameobject.transform.position, Vector3.up, -rotate_speed * Time.deltaTime); } if (Input.GetKey(KeyCode.D)) { if (!push_d_flag) { rotate_target = gameobject.transform.localEulerAngles - transform.localEulerAngles; transform.RotateAround(gameobject.transform.position, Vector3.up, rotate_target.y); push_d_flag = true; } } else { push_d_flag = false; } } else if (state_info_ == Game_system.state_info.Gameover) { transform.position = gameobject.transform.position; transform.position += new Vector3(0.0f, 4.0f, 0.0f); transform.rotation = Quaternion.Euler(90.0f, 0.0f, 0.0f); } } }