[MUSIC] Up to this point we've just been working in our sandbox Level 1 scene. But we often wanna create additional scenes for things such as loading screens, main menus, instructions, credits, game over screens, and game victory screens. All of these things make our game feel much more complete. In this lecture, we'll add several out-of-game scenes to our project. Our objectives will be to import the assets, which will serve as a basic template for these out-of-game scenes, explore the out-of-game scenes, discuss the use of custom fonts in Unity UI, add the scenes to our BuildSettings, and modify the Game Manager to transition to these scenes. So the first thing that I wanna do is I wanna import the menu assets Unity package that we downloaded as part of our initial assets. So I'm just gonna go ahead and double click on it and it should bring up the Import Package window. You can see it's gonna bring in a number of scenes, an art asset, a font, a prefab, and some scripts. So I'm gonna go ahead and import everything. So let me open up the _scenes folder, you can see we've got several new scenes here and let me go into the loading scene. So you can see down here in the game view, this is simply kind of like a title screen that will play as the game starts up. It has little Sparty there and it says Super Sparty Bros. Notice this is actually a custom font. So within the canvas, we've got our title text, and notice the font is not Arial, which is the built in font, it's Adventure. If I actually tap on this, this was an asset that was brought in with that package and this is just a Open Type font. Within a Unity project, you can actually import Open Type or True Type fonts, and then use those within the UI. So it's a great way to create stylized text that's something other than Arial. And of course the font file is just like any other game object. There's many great resources online to find free Creative Commons fonts, of course you can also purchase fonts for inclusion. So what the loading scene does is it displays this message, then after a couple of seconds it moves on to the Main Menu. So that functionality is provided within the manager game object. You can see there's a function called Menu Pause and Load Level, which basically pauses for the defined number of seconds and then moves to the Main Menu. Now if I actually play this, notice what happens. So after two seconds, I get an error message down here. Let me stop this and let's look at the error message in the console. Whenever you see red down here, just realize that's probably an important error message that you do need to look at and address. So this says, scene Main Menu couldn't be loaded because it has not been added to the BuildSettings or the asset bundle has not been loaded. To add a scene to build settings use Menu > File > BuildSettings. So this is exactly what I need to resolve this issue. Let me go ahead and close the console. So we've got multiple scenes now and we've gotta include them in our BuildSettings so we can actually move between the scenes, even in the Unity Editor. So under File, let's go to BuildSettings. And notice I don't have any scenes currently in my BuildSettings. You can always click add current, this'll bring in the current scene. We also have to think a little bit about the order. So when our project first starts we probably wanna start with the loading scene. And then let's bring in the other ones so I can just drag and drop them. So I'll bring over the Main Menu, and then Level 1 perhaps, and then the game lose and game win. So these are all different scenes that we'll look at here in a moment. So really the most important one is the first one because generally that fires it off, and then through code, it would jump to whatever scene is appropriate. So now that we have those in our BuildSettings, let's go ahead and test this again. So after two seconds it should move to the Main Menu and from the Main Menu I can click New Game which would then load Level 1 and let me just quickly kill myself here. So I'll die a couple times here. [SOUND] And a third time. And what happens? It reloads Level 1 and sort of resets the state, because we haven't actually set up the linking properly. So let me stop this, and notice when you're going across multiple scenes in play, and then you stop, it goes back to the original scene. So let me go into Level 1, and remember the Game Manager had these properties of where to go after Game Over and Level Victory. So we need to set these up now. So after victory, we wanna go to the game win screen, and after losing, we wanna go to the game lose screen. Now eventually if we have multiple levels after beating this level, maybe we would go to Level 1 for example, rather than to the game win screen. But that's easy to modify here in the Game Manager. So let me go ahead and save that, and let's test this once again. So I'll go back to the loading screen just to kind of simulate what the player would see. Say New Game, and once again I'll try to quickly kill myself here. [MUSIC] Okay, so I lost the game. It loads the Game Over screen, I can click Main Menu, go back to the Main Menu. Start a New Game, and this time I'll win very quickly, isn't that hard to do in this level. And this loads the game victory, or the game win screen. Sparty is Victorious! You beat the game, now beat you're high score. Okay, so challenge me to keep playing and improve my score. If I go back to the Main Menu, notice we have a Level Select where we can just select Level 1, but ultimately if we had more levels we could define those levels here. And there's an About screen that has quick instructions, controls, sort of a little credits here, and a copyright message. [MUSIC] So all of those came in with that Unity package. You could go in to any of these scenes, like game win, they're all set up very similar. They've got a canvas, the canvas has a title that we see up here and in this case, a subtitle or what we call flavor text. And then there's a Menu Panel which has a button on it. Within the scene, we have a manager game object, so here we've attached that manager game object reference. So on click basically we're gonna call the function called LoadLevel and pass in Main Menu. So on the manager, you could actually see the menu button LoadLevel script which simply has a public function called LoadLevel where we pass the string and based on that string we call Application.LoadLevel. So this is what loads the Main Menu, for example, when we click the Main Menu button. So fairly straight forward out-of-game menus that really make our game feel more complete. [MUSIC]