-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learning C# by Developing Games with Unity 3D Beginner's Guide
By :

We're going to modify some States and create some new ones. We're also going to use three Scenes.
Create three Scenes: Scene0
, Scene1
, and Scene2.
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 Scene0
:
public BeginState (StateManager managerRef) { manager = managerRef; if(Application.loadedLevelName != "Scene0") Application.LoadLevel("Scene0"); }
Make new C# classes for the new States. The following State Machine files should be coded as shown in Appendix A:
The BeginState
file
The SetupState
file
The PlayStateScene1_1
file: (1 of 2 available States in Scene1)
The PlayStateScene1_2
file: (2 of 2...
Change the font size
Change margin width
Change background colour