Hello I have been having some trouble trying to create a simple splash screen. What I want to do is when the character goes to the final teleporter it fades to a splash screen that says thank you for playing etc, then after a few seconds goes back to the main screen. I have looked around and unity doesnt identify Fade for some reason :S
Here is my code so far
function OnTriggerEnter(other : Collider){
var startTime = Time.time;
var fadeDuration = 2.0;
var i = 0;
while (i <= 1) {
i = (Time.time - startTime) / fadeDuration;
guiTexture.color = new Color(1,1,1,i);
yield;
}
Application.LoadLevel("0");
}
I have tried using things like `yield Fade.use.Alpha(guiTexture, 1.0, 0.0, 1.5);` but I donnot why it doesnt work, I'm still learning.
Thanks for the help
[EDIT]
I have updated it so that the Splash screen goes onto another scene however as the scene fades into the other scene, the fade on the other scene loads up automatically, so you dont see the splash screen long enough. Here is the script from the teleporter.
var teleporterSound : AudioClip;
//when player hits the object the game ends
function OnTriggerEnter(other : Collider){
audio.clip = teleporterSound;
audio.Play();
//fade to splash screen
LevelLoadFade.FadeAndLoadLevel(3, Color.white, 1.0);
}
And here is the script from the splash screen- ideally id like it to fade out onto the main menu.
//fade to splash screen
LevelLoadFade.FadeAndLoadLevel(0, Color.white, 2);