Create a sprite atlasGraphics: A utility that packs several sprite textures tightly together within a single texture known as an atlas. More info. 2D: A texture that is composed of several smaller textures. Also referred to as a texture atlas, image sprite, sprite sheet or packed texture. More info.
See in Glossary and pack sprites into it.
Note: You can also create multiple sprites from a single texture instead. For more information, refer to Import a sprite or spritesheet texture and Cut out sprites from a texture.
To optimize the performance of sprite atlases and the memory they use, do the following for each texture you want to pack:
Select Open Sprite Editor and check the following:
To create a sprite atlas, from the main menu, go to Assets > Create > 2D > Sprite Atlas.
Unity creates a file with a .spriteatlasv2 file extension in the Project window. Unity no longer uses Sprite Atlas V1 format by default. For more information, refer to Convert Sprite Atlas V1 assets.
For more information about assigning sprites to different sprite atlases, refer to Sprite atlases.
In the Project window, select the sprite atlas asset.
To add a sprite to the sprite atlas, drag a sprite from the Project window onto the Objects for Packing label in the Inspector window.
You can drag sprites, textures, or folders onto the Objects for Packing label. You can also select the Add (+) button in the Objects for Packing section.
Select Pack Preview to display the packed texture in the Preview window at the bottom of the Inspector window.
If your textures have normal maps or mask maps as secondary textures, select the dropdown at the top-right of the Preview window to display the combined secondary textures.
Sprites now render using their sprite atlas texture in the Scene view, the Game view, and in Play mode. Unity also includes sprite atlases in your builds by default, and automatically loads and uses them at runtime.
Note: If you add a sprite to multiple sprite atlases, Unity randomly chooses which sprite atlas texture to use at runtime. To avoid this, refer to Load sprite atlases manually at runtime.
To report on and analyze the performance of your sprite atlases, use either of the following:
To use the original unpacked textures in the Scene view and Game view, but keep using the sprite atlas textures in Play mode and at runtime, follow these steps:
For information on other Mode values, refer to Editor settings.
SpriteAtlasManager.CreateSpriteAtlas