before someone said that I would like to introduce the use of Sprite Packer. Then I would like to introduce you by the way.
The pictures we use to make sprites are usually left with a lot of blank space, and after we've finished the sprite, these places are probably not going to work. If we want to avoid the waste of these resources, we can make each sprite into Atlas, the space on the image as far as possible to enrich a little. At this point, we need a tool to make the atlas.
In fact, this function to write their own is not difficult, just the pictures on each sprite to do the copy pixel processing, and then calculate a rectangular range, all the picture pixels picked up according to a certain rule on a picture above. But these lower-level things many people will be afraid and choose to escape, so there are many tools directly available, such as the newer version of Ngui has this automatic Atlas function, or there are many Atlas production software.
Unity3d in the 2D function, but also comes with the production of the Atlas tool, that is, Sprite Packer. The following is a brief introduction to its usage:
before using this function, we need to go to editor setting to open the Sprite Packer:
then open the Sprite Packer window:
This is the Sprite Packer window, the main operation, is actually the upper left corner of the pack button. But now we press this button and nothing is going to happen.
in our project folder, I put a few sprites that have been cut.
Select these sprites and enter a name for the packing tag in the attribute. Here I have all the sprite input Enemys:
now for the pack button, something will come up. This is the atlas that has just put the sprite together.
If we change the packing tag of the lead potato man to players (or any other name that is not the same as before)
We'll come back to the pack and we'll see that the potato man disappears in the atlas.
in this Atlas selection, we can see the new players categories that have just been added:
choose players and see the potato man again. This is because the sprite Packer does the atlas according to the packing tag tag, which divides the same tagged objects into one class and then makes them.
There's really not much we can do, and this process is done automatically. When we are done, we select the sprite below the project panel, and the corresponding sprite in the Atlas will become highlighted.
Since this function is so automated, then why is the first disabled state, we need to manually go to the editor setting inside the set open it? The reason is that this feature will take some time to work on when Unity opens the project, and if you need to calculate a lot of sprites, it will be slower to open. The calculated graph Assembly is placed in the cache folder Projectlibraryatlascache, and if you delete the contents, unity will be the atlas again. Then if you choose to make the Atlas, the sprite's original image is not compressed to pick up the pixel-making atlas.
For more information, please visit the "Dog Planing Learning Network" http://unity.gopedu.com
Unity3d Sprite Packer How to use