public void OnclickResetButton()// { if (testgm == null) { testgm = GameObject.Find("GameManager").GetComponent <Testgm>(); } testgm.Reset(); }
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 }
// 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); }