// ゲームクリア //****************************************** public void GameClear() { //GameObject soundManager = GameObject.FindGameObjectWithTag("SoundManager"); //SoundManager.Instance.StopBGM(); //// リスナーのボリュームを 0 に設定 //GameObject.Find("BGM").SetActive(false); GameCore_Script.RESULT_ROAD(); bGameMusicStop = true; if (GameObject.Find("GameOver")) { //audioSource.PlayOneShot(audioClip0); GameObject.Find("GameOver").SetActive(false); //GameObject Image = GameObject.Find("GameOver"); //Image.SetActive(false); } //GameCore_Script.RESULT_ROAD(); //AudioListener.volume = 0f; // GameObject Image = GameObject.Find("GameOver"); //Image.SetActive(false); //if (GameObject.Find("GameOver")) //{ // GameObject Image = GameObject.Find("GameOver"); // Image.SetActive(false); //} if (Input.GetKeyDown(KeyCode.Return)) { GameCore_Script.TITLE_ROAD(); } bGameStart = false; bClear = true; GameObject soundManager = GameObject.FindGameObjectWithTag("SoundManager"); SoundManager.Instance.StopBGM(); ////// リスナーのボリュームを 0 に設定 //GameObject.Find("BGM").SetActive(false); if (audioSource != null) { audioSource.PlayOneShot(audioClip0); } }
// ゲームオーバー //****************************************** public void GameOver() { //タワーの体力を変更してしまうとエラー if (audioSource != null) { audioSource.clip = audioClip1; } GameObject soundManager = GameObject.FindGameObjectWithTag("SoundManager"); SoundManager.Instance.StopBGM(); //// リスナーのボリュームを 0 に設定 //GameObject.Find("BGM").SetActive(false); //audioSource.PlayOneShot(audioClip1); GameCore_Script.RESULT_ROAD(); bGameMusicStop = true; if (GameObject.Find("GameClear")) { if (audioSource != null) { audioSource.PlayOneShot(audioClip1); } GameObject.Find("GameClear").SetActive(false); } if (Input.GetKeyDown(KeyCode.Return)) { GameCore_Script.TITLE_ROAD(); } //保留 //GameObject[] SuctionObj = GameObject.FindGameObjectsWithTag("Trash"); //foreach (GameObject Obj in SuctionObj) //{ // Obj.GetComponent<SuctionObject_Script>().Explode(); //} bGameStart = false; bGameOver = true; //audioSource.clip = audioClip1; //GameObject soundManager = GameObject.FindGameObjectWithTag("SoundManager"); //SoundManager.Instance.StopBGM(); //// リスナーのボリュームを 0 に設定 //GameObject.Find("BGM").SetActive(false); //audioSource.PlayOneShot(audioClip1); }