Game Development Reference
In-Depth Information
Instance.StartFade(aFadeOutTime, aFadeInTime, aColor);
}
I've included many more overloads for the manager in the sample project. So, it is as flex-
ible as it needs to be for the game, including the ability to pass a material to change the
fading image, specify alternate fading values, or fade to another level by index instead of
name.
Updating level loading to use fading
Next, in order to actually navigate to the world, we need to enable our Naviga-
tionManager script to actually load out next scene and use the new FadeInOutMan-
ager to transition smoothly.
So, open up the NavigationManager script in Assets\Scripts\Navigation
and look for the following lines:
public static void NavigateTo(string destination)
{
//Application.LoadLevel(destination); <- commented
out for now as we have nowhere to go :D
}
Update the previous lines with the following lines:
public static void NavigateTo(string destination)
{
FadeInOutManager.FadeToLevel(
destination,
2f,
2f,
Color.black);
}
Now, if you return to the town scene and run it and try to leave the town for the Big Bad
world, it will fail—but in a nice way.
Search WWH ::




Custom Search