Game Development Reference
In-Depth Information
Figure 1-19. Searching for Assets by Label using the Project panel Search field
Note Labeling an asset does not affect its file name or the physical folder inside which it's stored in the
Project. These remain unchanged regardless of labeling. Labels are Unity-specific metadata attached to the
file for your convenience when searching through assets.
GameObject tagging. In many respects, Tags are to GameObjects what Labels
are to Assets. Tags are special identifiers that you may attach to objects in
your scenes, to group them and search them, and to perform other kinds of
operations to them directly in code. Unlike Labels however, only one tag may be
assigned to an object—that is, an object can't have more than one tag assigned,
although many objects can share the same tag. Tags will be used extensively in
this topic—and we'll see them at work in some form in almost every subsequent
chapter. To create a new tag and assign it to an object, select any object in
the scene and click the Tag drop-down list at the top-left corner of the Object
Inspector. From the menu that appears, select Add Tag (see Figure 1-20 ). Doing
this displays the Tag Editor, where you can create new and custom tags—as
many as you need. Use the Size field to enter the number of tags to create, and
then name each tag using the Element fields below (see Figure 1-21 ). Once
created, the tags are added to the Tag list (see Figure 1-20 ). To assign a tag to
one or more objects, select all relevant objects and choose their tag from the
Tag list in the Object Inspector.
 
Search WWH ::




Custom Search