// Update is called once per frame void Update() { if (firstTime) { if (bouManager2 == null) { bouManager2 = GameObject.Find("BouManager").GetComponent <BouManager2>(); } bouManager2.AllWait(); firstTime = false; } if (isMove) { Moving(); } //debug /*if(!isMove) * { * if (Input.GetKey(KeyCode.N)) * { * if (NextStage() == -1) * { * * } * * } * if (Input.GetKey(KeyCode.R)) * { * Reset(); * } * }*/ }
void Moving() { float x = stageObject[1].transform.position.x * moveCoefficient; if (x < 0.01) { stageObject[1].transform.position = new Vector3(0.0f, 0.0f, 0.0f); isMove = false; Destroy(stageObject[0]); stageObject[0] = stageObject[1]; stageObject[1] = null; nowStageNum++; bouManager2 = stageObject[0].transform.Find("BouManager").GetComponent <BouManager2>(); player2 = stageObject[0].transform.Find("Player").GetComponent <Player2>(); player2.SetMoveflag(true); //bouManager2 = GameObject.Find("BouManager").GetComponent<BouManager2>(); bouManager2.AllDefaultReset(); player2.DefaultReset(); gameManager.state = GameManager.GameState.Game; if (camera == null) { camera = Camera.instance; } camera.isStageMove = false; stageNumText.text = ""; return; } for (int i = 0; i < stageObject.Length; i++) { stageObject[i].transform.position = new Vector3(stageObject[i].transform.position.x - x, stageObject[i].transform.position.y, stageObject[i].transform.position.z); } }
public void Screen_Tap(Enum state)//ボタン以外をクリック { if (EventSystem.current.IsPointerOverGameObject()) { return; } //状態によってタップ時の処理を変える if (Input.GetMouseButton(0)) { switch (state) { case GameManager.GameState.Title: //タイトル画面でタップされた処理 gamemanager_script.state = GameManager.GameState.Game; if (player2 == null) { player2 = GameObject.Find("Player").GetComponent <Player2>(); } player2.moveflg = true; titleui.SetActive(false); GameObject.Find("StageNumText").GetComponent <Text>().text = ""; if (bouManager2 == null) { bouManager2 = GameObject.Find("BouManager").GetComponent <BouManager2>(); } bouManager2.AllGrow(); break; case GameManager.GameState.Gameover: //ゲームオーバー時にタップされた処理 break; } } }
// Start is called before the first frame update void Start() { instance = this; bous = new bou2[instance.transform.childCount]; for (int i = 0; i < bous.Length; i++) { bous[i] = instance.transform.GetChild(i).GetComponent <bou2>(); } gaugeManager = GameObject.Find("Gauge").GetComponent <GaugeManager>(); gaugeManager.InitFillAmount(); clearFlag = false; isGameOver = false; }
void Start() { instance = this; player2 = Player2.instance; boumanager2 = BouManager2.instance; testgm = Testgm.instance; state = GameState.Title; onetimeflg = true; //一度だけ実行させる用 operationflg = false; // //gameoverui.SetActive(false); audiosource = GetComponent <AudioSource>(); //#if WINDOWS_UWP Screen.SetResolution(576, 1024, false); //#else // Screen.SetResolution(1080, 1920, Screen.fullScreen); //#endif }
public void Reset() { if (isMove) { return; } GameObject.Find("GameClearText").GetComponent <Text>().color = new Color(1.0f, 1.0f, 1.0f, 0.0f); GameObject.Find("GameOverText").GetComponent <Text>().color = new Color(1.0f, 1.0f, 1.0f, 0.0f); if (bouManager2 == null) { bouManager2 = BouManager2.instance; } bouManager2.AllReset(); if (player2 == null) { player2 = Player2.instance; } player2.Reset(); }
// Start is called before the first frame update void Start() { player2 = Player2.instance; instance = this; nowStageNum = 0; isMove = false; difference = 100; moveCoefficient = 0.05f; stageData = Resources.Load <StageData>("TestStageData"); stageObject[0] = Instantiate(stageData.stage[nowStageNum]); bouManager2 = GameObject.Find("BouManager").GetComponent <BouManager2>(); if (gameManager == null) { gameManager = GameManager.instance; } gameManager.SetMaterial(GameObject.Find("Player")); stageNumText = GameObject.Find("StageNumText").GetComponent <Text>(); int nowStage = nowStageNum + 1; stageNumText.text = "STAGE " + nowStage; //camera = Camera.instance; }
void Update() { switch (state) { case GameState.Title: kamifubuki.SetActive(false); TitleArrive(); Time.timeScale = 1; break; case GameState.Game: operationflg = false; buttonui.SetActive(true); Time.timeScale = 1; if (oldState != state) { break; } if (player2 == null) { player2 = GameObject.Find("Player").GetComponent <Player2>(); } if (boumanager2 == null) { boumanager2 = GameObject.Find("BouManager").GetComponent <BouManager2>(); } if (player2.IsGameOver() || boumanager2.IsGameOver()) { state = GameState.Gameover; GameObject.Find("GameOverText").GetComponent <Text>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f); } if (boumanager2.IsClear()) { audiosource.PlayOneShot(clearsound); state = GameState.Gameclear; kamifubuki.SetActive(true); GameObject.Find("GameClearText").GetComponent <Text>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f); } break; case GameState.Gameclear: Invoke("InvokeOperation", 1.5f); Time.timeScale = 1; if (Input.GetMouseButton(0) && operationflg == true) { if (testgm == null) { testgm = Testgm.instance; } if (testgm.NextStage() == -1) { SceneManager.LoadScene("Endroll"); //最終ステージクリア } kamifubuki.SetActive(false); operationflg = false; } break; case GameState.Gameover: buttonui.SetActive(false); Invoke("InvokeOperation", 0.25f); Time.timeScale = 0.1f; //gameoverui.SetActive(true); if (Input.GetMouseButton(0) && operationflg == true) { if (testgm == null) { testgm = Testgm.instance; } testgm.Reset(); state = GameState.Title; operationflg = false; } break; } oldState = state; oldMouseButton0 = Input.GetMouseButton(0); }