Game Development Reference
In-Depth Information
Starting with the header in the Inspector panel, as you can see in Figure 3-5 , the first checkbox
indicates the game object is active in the scene. If you deselect it, you will notice the cube
disappears from the Scene view but not the Hierarchy view. It hasn't been deleted from your project;
deselecting it allows you to move it out of the way while you are working on something else. Leave
this box checked.
Next, the default name of the game object is Cube. If you change the name in the Inspector panel,
you will see the change reflected in the Hierarchy view, and vice versa.
Tags are used to identify groups of game objects such as Players or Enemies. This enables you to
write scripts that can easily find and affect only the game object group of interest.
Layers is a different way to group objects for other purposes such as ray casting, lighting, and
rendering limited to specific groups of objects within a scene.
The Static checkbox should be checked for environmental objects that will not be moving around
in your scene. Using Layers and the Static checkbox helps Unity reduce the overall amount of
calculations it must make for rendering the game, which in turn makes your game run more smoothly.
The rest of the contents in the Inspector panel are the list of components comprising the Cube
game object.
Components
The true power of the Unity game engine is in its components. Components govern the look,
behavior, and interaction of the game objects. Unity provides you with bunches of ready-made
components from which to build your game objects. Take a look at the Component top menu and
the contents of the drop-downs in it (Figure 3-6 ).
Figure 3-6. Unity Component top menu
You can add components to game objects through this menu, or as you did with your script in
Chapter 2 by using the Add Component button in the Inspector panel.
Most important is the Transform component, the one component that every game object must have.
The position, rotation, and scale properties of Transform define the game object's existence in the
scene in terms of location, orientation relative to the scene, and size. Even an Empty game object
must have a Transform component.
 
Search WWH ::




Custom Search