How to add fade effect in/out (scenes)

Hi I wand to add fade effect while the level change. I’m using following script to change level.


var levelToLoad : String;
function Start () {

yield WaitForSeconds(3);
Application.LoadLevel(1);
}


Can anyone fix this code or tell another, So that there be fading effect while game move to next level.

There’s some free cross-fading script which someone will find. But in the mean time, an easy way to do this is to put a Plane in front of the camera, use a Transparent/Diffuse shader, and animate the alpha channel on it so that when it’s transparent (and you can turn it off at that point) it shows the scene, but when it’s not transparent, it’s black or whatever color you want. So you can ‘fade to black’. Then run the reverse of that at the start of your next scene to fade in.