- Home /
Answer by gfoot · Jan 28, 2014 at 09:40 PM
You need to perform several steps to enable the feature:
Go to "Edit / Project Settings / Editor" and set the "Sprite Packer" mode to something other than "Disabled". Here you choose whether you want to use packed sprites in the editor, or only in standalone builds.
Give your sprites "Packing Tags" by editing their import settings in the Inspector. Packing tags are like atlas names - this controls which sprites get packed together. So any sprites with identical packing tags will be packed into an atlas together.
Open the "Sprite Packer" window (from the Window menu) and press "Pack" to repack all your sprites.
You will then be able to use the Sprite Packer window's controls to choose which atlas and page to view, and clicking on a sprite in the Project pane will highlight it in the Sprite Packer too (automatically selecting the right atlas and page).
Cool, it worked! But now the sprite editor won't slice the atlas. I'm trying to get it animated, but the atlas doesn't even give me the separated sprites.
Generated atlases are not useful for animation - as far as your code or editor work is concerned, the atlas doesn't exist. It is an optimization that Unity performs behind the scenes. So if you need your sprites arranged on an image for animation purposes then you need to do that step yourself.
You can still use the automatic atlas generation as well if you want to, in which case Unity will take all the sprites you slice out of the source image and rearrange them in a new atlas, along with any other sprites with the same packing tag, and this will reduce draw call overheads.
If you have pro, you can use asset post-processing to automate the process of combining separate source images into an atlas of your own - there are probably scripts on the Asset Store already that can do this for you. Without pro, you can do the same thing in an editor script driven by a menu option. Other ways to generate this are Photoshop/Gimp plugins - so you edit a layered image and use an export plugin that arranges the layers in a grid.
Your answer
Follow this Question
Related Questions
Unity 5.2 Sprite packer too slow 1 Answer
Sprite with Multiple mode VS 2017 Sprite Atlas 0 Answers
Get the atlas of a sprite in editor 0 Answers
2d sprite animation issue 2 Answers
Convert Sprite Image to Texture 6 Answers