Sprites and Sprite Atlas both in (Android) build

Hello,

When I’m building my android apk and I include the Sprite Atlas in my build, it pakcs both the atlas and all the resources that are in it seperately. Can someone maybe explain to me how this works?
As I found this in the documentation:

Scenario 1: Basic Sprite Atlas usage

  • Sprite Atlas A contains Sprite 1.
  • Sprite Atlas A has Include in Build enabled.
  • Result: The Project’s published build includes Sprite Atlas A. Sprite 1 renders with the Texture from Sprite Atlas A.

Link: Unity - Manual: Resolving different Sprite Atlas scenarios

But when I do this, the result is different.
I do get both the sprites and the sprite atlas in my build, and thus increasing size.

Editor log:
256.2 kb 0.3% Built-in Texture2D: sactx-512x512-ETC2-Blue-2bc0bf41

3.6 kb 0.0% Assets/_UI Assets/Blue.spriteatlas

0.5 kb 0.0% Assets/_UI Assets/blue/blue_sliderLeft.png
0.5 kb 0.0% Assets/_UI Assets/blue/green_panel.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_panel.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button09.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button07.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button06.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button05.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button03.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button01.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_boxCross.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button12.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button10.png
0.5 kb 0.0% Assets/_UI Assets/blue/blue_button08.png
(etc. list is way longer)

So reading the docs, I wouldn’t expect that last list of textures being inside the build?

Thanks!

If a sprite is part of Atlas, the source texture is never added to the build, only the sprite (which does not hold any texture data, just sprite and some geometry info). The only texture that is built for texture is the Atlas texture (sactx-128x128-ETC2-New Sprite Atlas-5788029a)

Based on above post ( Sprite Atlas adding on build size. ) , :
0.7 kb 0.0% Assets/icon_dolar.png (Sprite) => This is not Texture but Sprite data (vertices, properties etc…)
0.2 kb 0.0% Assets/New Sprite Atlas.spriteatlas (SpriteAtlas)
16.1 kb 0.0% Built-in Texture2D: sactx-128x128-ETC2-New Sprite Atlas-5788029a (Texture2D) => Texture for the Sprite.

Source texture is only included if its also referenced elsewhere other than SpriteRenderer (for example like Material etc…) or inside resource folder.

The idea of Sprite-Atlas is to pack all source textures of sprites to a single texture and use it as a source for the sprites. So this is exactly as expected.

1 Like