With a state manager that handles multiple games scenes, we can now move on to loading those scenes in the game. In the next recipe, we add the level_1
scene to our project and modify the code so that level_01
is loaded upon pressing the interface button displayed in the game_starter scene.
We keep up from where we left at the end of previous recipe. Just be sure that you have the game_starter scene loaded in your project and that an empty game object called game_starter is present in the scene, with the GameStart script attached to it. You can refer to the following screenshot:
With Game Start scene loaded in Unity, navigate to File | Build Settings to open the Build Settings panel.
Click on AddCurrent to add the loaded scene to the game build, as shown in this screenshot:
Now load the scene called
level_01
. Refer to the following screenshot to check out the scene that contains the right game object: