Book Image

Mastering Unity Scripting

By : Alan Thorn
Book Image

Mastering Unity Scripting

By: Alan Thorn

Overview of this book

Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Batch renaming


When creating scenes with multiple enemies, power-ups, props, or other object instances, you'll typically use the duplicate feature to clone objects (Ctrl + D). This leads to many objects sharing the same name. Now, while there's nothing technically wrong in name duplication per se, it's both inconvenient and untidy. It results in a hierarchy panel of many identically named objects, and it's practically impossible to distinguish between specific objects by their name alone. Furthermore, object searches in script using the GameObject.Find function cannot be relied on to retrieve the specific object that you need, since it could return any one of the identically named objects. The solution, then, is to name each object uniquely and appropriately. But doing this can be tedious, especially if you're working with many objects. Thus, there's a need for a Batch Rename tool.

This would, in theory, allow you to select multiple objects in the hierarchy panel and then to rename them automatically...