public IEnumerator ExecutaFade(CrossfadeMusica novaMusica, float tempoDeEspera, float fadeIn, float fadeOut) { novaMusica.MudaVolume(0, fadeOut, false, 0, false, false); yield return new WaitForSeconds(tempoDeEspera); musica.volume = 0; MudaVolume(1, fadeIn, false, novaMusica.musica.time, false, false); }
void EncontraMusica() { string nomeDaMusica = Globais.faseAtual; if(nomeDaMusica.Contains("MiniGame")) nomeDaMusica = "MiniGame"; GameObject musicaGO = GameObject.Find("Musica "+nomeDaMusica); if(musicaGO != null) musica = musicaGO.GetComponent<CrossfadeMusica>(); }