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

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

Chapter 9, Start Building a Game and Get the Basic Structure Running, finished with SetupState
. Now we need to switch to the next State, PlayStateScene1_1
. At the bottom of the SetupState screen is a button Click Here or Press 'P' to Play.
In SetupState
, here's the code for that button:
An analysis of the code shown in the preceding screenshot is as follows:
Line 69: player.transform.position = new Vector3(50, .5f, 40);
In Scene1, Player
will use physics to hover and move. Here is the relevant code in PlayStateScene1_1
:
An analysis of the code shown in the preceding screenshot is as follows:
Line 15: if(Application.loadedLevelName != "Scene1")
true
, Scene1 is not loaded, therefore:Line 16: Application.LoadLevel("Scene1");
Line 10: private GameObject player;
player
will...Change the font size
Change margin width
Change background colour