Game Development Reference
In-Depth Information
Object naming
There are no specific patterns for how you should name each object/component in your
asset library as such. Generally, this is left to your preference, and more importantly, how
you recognize each part of your game. There is no need to give something a really long
and complicated name in the preceding structure, only so long that you can find it later.
Many of the other tutorials I have read or watched tend to lean on a few patterns for nam-
ing, most of which seem to follow the usual coding standards such as the following:
• Prefixing the name with a three letter acronym for its type: scn for a scene, efx
for an effect, and so on
• Suffixing an underscore plus the same three letter acronym to the end of an asset's
name
• Using a path-like name such as playerScene1BounceToWallScript
From experience, these are useful, but my advice is to name things plainly based on what
it is. Using the structure mentioned earlier, you have already organized your assets to
overcome a lot of the issues that the preceding patterns try to solve.
Plan ahead before you even start your game and set a standard that works for you. You
should be able to identify what each asset is and what it does just by looking at the name.
However, remember that each asset will most likely be used many times on many differ-
ent game objects, so plan accordingly. Add prefixes and suffixes only when a script or as-
set is intended to be limited to a certain type of game object.
The Unity examples are another good place to look for inspiration here. See the following
screenshot and decide whether you can tell what these scripts are and what they are used
for just by looking at them:
Search WWH ::




Custom Search