public void LoadLevel(string name){
Debug.Log ("New Level load: " + name);
Application.LoadLevel (name);
FadeOut(audioSource: 3f);
}
public void QuitRequest(){
Debug.Log ("Quit requested");
Application.Quit ();
}
public static IEnumerator FadeOut (AudioSource audioSource, float FadeTime) {
float startVolume = audioSource.volume;
while (audioSource.volume > 0) {
audioSource.volume -= startVolume * Time.deltaTime / FadeTime;
yield return null;
}
audioSource.Stop ();
audioSource.volume = startVolume;
}
What is wrong in this line
FadeOut(audioSource: 3f);
Thanks a lot.