Game Development Reference
In-Depth Information
Note One way to keep archives—and especially backups of source code—is to use version control
systems. The Unity Team license includes a range of options, including Perforce, Plastic SCM, and the Asset
Server. Other options include GIT, CVS, Mercurial, LibreSource, and others.
One question that commonly arises is “How often should I make backups?” The answer depends
primarily on you and your circumstances. At the end of each work day or work session, ask yourself:
“If I lost all my data now, and I had to resort to an earlier backup, how terrible and annoying would that be
for me right now? How much work and time would I have to reinvest simply to catch up to where I was?”
Think about these questions and be honest with yourself. If thinking about this makes you uncomfortable,
and if the idea of losing your data is especially unpleasant, then it's time to make a backup.
Note The practice of making regular backups might seem to you so obviously important that it hardly
requires mentioning at all. It surely goes without saying. If this is how you feel, then splendid! You don't
need me to convince you to make backups. However, despite the lip service often given to the importance of
backups, I often find people never making them and then later regretting that decision. So the importance of
making regular backups cannot be overstated.
Tip #9: Batch Renaming
Sometimes you'll be working with lots of similar game objects in a Unity scene, such as a batch of
enemies, or ammo crates, or power-ups, or trees, or rocks, and others. You'll typically want each
object in the batch to have a similar but distinct name from all the others, such as Tree_01 , and
Tree_02 , and Tree_03 , and so forth. Now, it can tedious and time-consuming to name each of these
objects individually. Unfortunately, Unity (at the time of writing) has no out-of-the-box functionality
to automate this process. So often it's convenient to customize the Unity Editor and create our own
Batch Renaming functionality. In this section, therefore, I want to introduce you to a custom-made
Batch Rename tool, which is an editor extension that plugs into the Unity interface and offers simple
renaming functionality for multiple objects. The source code for this tool is listed in Listing 1-1 for
your viewing, and is also included in the Project Files (inside the Chapter01 folder).
Listing 1-1 BatchRename.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
public class BatchRename : ScriptableWizard
{
//Base name
public string BaseName = "MyObject_";
 
Search WWH ::




Custom Search