Game Development Reference
In-Depth Information
This chapter provides an introduction to programming. If you've had some exposure to
programming, don't skip it—the examples include a number of common Unity-specific variables and
functions that you will use in the chapters ahead.
MonoDevelop
When Unity creates a new project, it provides you with the skeleton of a game. This skeleton has
the basic necessities of any game, so when you click on the Play button the empty game still knows
how to start, and then how to stop when you deselect Play. Game development is fleshing out this
skeleton with digital content and interaction with game objects, environments, and scripts.
In the top menu, select GameObject ➤ Create Empty (Figure 2-8 ).
Figure 2-8. Unity top menu GameObject Create Empty
You will see the new GameObject listed in the Hierarchy view, its transform gizmo in the Scene view,
and further details in the Inspector (Figure 2-9 ).
Figure 2-9. New GameObject in the Unity editor
In the Inspector, click the Add Component button, then select New Script from the menu that
appears. Name your script HelloWorld, make sure the language is Java Script, then click Create
and Add to attach this script to the empty game object (Figure 2-10 ). By convention the name
is descriptive, and it should be capitalized without special characters or spaces, though the
underscore is allowed.
 
Search WWH ::




Custom Search