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

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

Add a Plane GameObject and a Cube GameObject to the Scene panel. Add a Rigidbody Component to the Cube GameObject so it will fall to the Plane GameObject. Also add a Directional Light to the Scene panel if there isn't one already. Then we'll add a GUI button to switch to the PlayState
object. To do so, perform the following steps:
In the menu, navigate to GameObject | Create Other | Plane.
In the Inspector panel, make sure the Position is 0,0,0 for X,Y and Z.
In the menu, navigate to GameObject | Create Other | Cube.
Set the values in the Inspector panel as shown in the next screenshot.
Select Cube in the Hierarchy panel.
In the menu, navigate to Component | Physics | Rigidbody.
In the menu, navigate to GameObject | Create Other | Directional Light if needed.
Add the following code to the code block of the ShowIt()
method of BeginState
:
if (GUI.Button(new Rect(10, 10, 150, 100), "Press to Play"))
{
manager.SwitchState (new...
Change the font size
Change margin width
Change background colour