Game Development Reference
In-Depth Information
In the Project panel select Create ➤ Folder and name it Prefabs. In the Hierarchy view, first rename
Cube to Pink Rose Cube by double-clicking slowly. Once renamed, drag it from the Hierarchy view
and drop it into the Prefabs folder. Doing this creates a template for this game object, distinct from
the original cube (Figure 3-21 ). In the Hierarchy view, go ahead and delete the game object by
selecting it, then pressing
+Backspace.
Figure 3-21. Prefab game object in the Project panel Prefabs folder
Before populating the scene with prefab cube clones, here is a nifty tip for organization: to keep your
Hierarchy view organized, empty game objects can be used like folders. Use either Shift+
+N or, in
the Unity editor top menu, select Game Object ➤ Create Empty. Rename it Snazzy Cubes.
From the Prefabs folder in the Project panel, drag a Pink Rose Cube and drop it into Snazzy Cubes
in the Hierarchy view. The new prefab game object appears at origin in the Scene view. With this
new game object selected, press
+D (D for duplicate) or from the top menu use Edit ➤ Duplicate
to create a new instance of the game object. A second Pink Rose Cube game object appears in the
Hierarchy view, indented under Snazzy Cubes to indicate it is a child object of the Snazzy Cubes
parent object (Figure 3-22 ).
Search WWH ::




Custom Search