void Awake() { instance = this; if(Application.loadedLevelName == "MainMenu") { gameState = GlobalInfo.GameState.MENU; } else { gameState = GlobalInfo.GameState.INGAME; } MainCameraController.FindOrCreate(); SoundController.FindOrCreate(); }
public void StartMusic(GlobalInfo.GameState gameState) { if (gameState == GlobalInfo.GameState.INGAME) { int randomSong = Random.Range(0, this.musicGame.Count); this._currentSong.clip = musicGame[randomSong] as AudioClip; this._currentSong.Play(); } else if (gameState == GlobalInfo.GameState.MENU) { int randomSong = Random.Range(0, this.musicMenu.Count); this._currentSong.clip = musicMenu[randomSong] as AudioClip; this._currentSong.Play(); } }
void Awake() { instance = this; if (Application.loadedLevelName == "MainMenu") { gameState = GlobalInfo.GameState.MENU; } else { gameState = GlobalInfo.GameState.INGAME; } MainCameraController.FindOrCreate(); SoundController.FindOrCreate(); }