I’m trying to fade out my music track (ambientSoundTrackTwo), which is spawned by an AudioControl script, as soon as a new scene is loaded. I’ve written the following code on my AudioControl.cs, but it doesn’t seem to be working:
void OnDestroy()
{
ambientSoundTrackTwo.stop (FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
Debug.Log ("Close Scene");
}
The Debug message is printed on the Console when the scene closes, though, so I guess the OnDestroy function is working.
Any ideas?
Thanks