//ゲームオーバー処理 private void GameOver() { Gameover.gameObject.SetActive(true); menumanager.SetActive(false); Audio_BGM.Stop(); Audio_SE.PlayOneShot(GameOver_SE); AllObjectFalse(); }
private Audio_BGM bgm; //bgm object // Use this for initialization void Start() { //access self, transitions and bgm transition = self.GetComponent<Transitions>(); //returns a sample script of Transitions into the script bgm = self.GetComponent<Audio_BGM>().GetInstance(); //returns the actual Audio_BGM script bgm.PlayTrack(0); //play the track }
private void Awake() { if (_instance == null) { _instance = this; } else { Destroy(gameObject); } m_BGMAudio = GetComponent <AudioSource>(); }
void Awake() { //check if there isnt an instance yet if(instance == null) { instance = this; } //if there is already an instance else if(instance != this) { //destroy this pattern. ensure that it only plays once. Destroy(gameObject); } //Set it not to be destroyed when reloading a scene DontDestroyOnLoad(gameObject); }
//ステージセレクト画面に戻る public void StageSelectButton() { Audio_BGM.PlayOneShot(drum_dd); SceneManager.LoadScene("SelectScene"); }
//ステージを最初からやり直す public void ReplayButtton(int i) { Audio_BGM.PlayOneShot(drum_d); SceneManager.LoadScene("GameScene" + i); }