Names
There are currently two issues with the Sprite
names:
- They don't include the character name so you can't differentiate between them based on their name which is helpful for debugging. When we combine them into a Sprite Atlas having multiple sprites with the same name would prevent anything that references them (such as animations) from being guaranteed to get the correct sprite. And when we Generate the Animations, the tool groups the selected sprites into separate animations based on their names.
- The enemies don't have names. Working with proper names is easier than trying to remember things by number.
So we want to give them the following names:
Sprite | Original Name | New Name |
---|---|---|
Enemy01 |
Gobbat |
|
Enemy02 |
Gobbler |
|
Enemy03 |
MawFlower |
|
Enemy04 |
Scarecrow |
|
Enemy05 |
Naga |
Renaming so many files individually would be really tedious, but fortunately the Rename Sprites tool in Animancer Pro makes the job much quicker:
- Open the Animancer Tools window (Window/Animations/Animancer Tools).
- Go to the
Rename Sprites
tool. - Select all of the
attackXX
sprites for the first enemy. - In the
New Name
field enterGobbat-Attack-
so that the selected sprites will be given that name with their frame number on the end. - Click
Apply
. - Repeat steps 3-5 with appropriate names for each of the other sprites for each character.
Sprite Atlas
When Unity renders a frame, it needs to perform at least one Draw Call for each texture being rendered. This could have a large performance cost if we were to keep using a separate texture for each Sprite
, so instead we can combine them all into a single large texture (known as a "Sprite Atlas") using the Pack Textures tool in Animancer Pro:
- Open the Animancer Tools window (Window/Animations/Animancer Tools).
- Go to the
Pack Textures
tool. - Drag and drop all the textures you want to combine into the
Textures
list. - Click
Pack
. - If any of the selected textures has not been set to
Read/Write Enabled
andCompression None
, click theMake Textures Readable and Uncompressed
button in the dialog box that appears. - Choose where to save the packed texture.
- Select the packed texture and apply the same Sprite Import Settings as before, except that the
Sprite Mode
must be left asMultiple
. DO NOT apply the Preset because it would set the mode toSingle
and clear all the individual sprite data.
With all the sprites in the atlas, the individual sprite files are no longer necessary so you may wish to move them somewhere else or simply delete them.