IEnumerator changeSongTime(songIndex si, float wait) { songDown.TransitionTo(wait); yield return(new WaitForSeconds(wait)); song.enabled = false; song.clip = songClips[(int)si]; songUp.TransitionTo(wait); }
void changeSong(songIndex si, float wait) { StartCoroutine(changeSongTime(si, wait)); }