Game Development Reference
In-Depth Information
Updating the NavigationManager script
As the player can now venture out of town, we need to update our
NavigationMan-
ager
script with additional places to visit, including our home town. We can do this
simply by adding additional routes to our
NavigationManager
script as follows:
public static Dictionary<string, Route> RouteInformation =
new Dictionary<string, Route>() {
{ "World", new Route {
RouteDescription = "The big bad world", CanTravel =
true}},
{ "Cave", new Route {
RouteDescription = "The deep dark cave", CanTravel =
false}}
,
{ "Home", new Route {
RouteDescription = "Home sweet home", CanTravel =
true}},
{ "Kirkidw", new Route {
RouteDescription = "The grand city of Kirkidw",
CanTravel = true}},
};
Nice and easy; although you should note one small flaw. We use the scene name as a way
to identify the area that we want to travel to and currently our home scene is called
Main
.
So, rename the
Main
scene to
Home
, which should leave you with the following scenes
in
Assets\Scenes
: