Time for action – setting up nine States and three Scenes
We're going to modify some States and create some new ones. We're also going to use three Scenes.
- Create three Scenes:
- In the menu, open File | Build Settings....
- Add the three Scenes to Scenes in Build.
- Temporarily add some GameObjects to Scene1 and Scene2 for testing.
- Open Scene1 and add a Cube GameObject.
- Open Scene2 and add two Sphere GameObjects.
- Reload Scene0
- Double-click on BeginState to edit
- Edit the
BeginState constructor method as follows to add an
if statement for loading
public BeginState (StateManager managerRef)
manager = managerRef;
if(Application.loadedLevelName != "Scene0")
- Make new C# classes ...