1
\$\begingroup\$

I have a simple SpriteAtlas: "UIAtlas" which is located in the Resources folder. It points to a folder "UIAtlas" which contains my menu textures.

All of my batching is working perfectly, everything is being batched, because of the atlas.

When I build an iOS version, in the Editor.log I can see this:

Build Report

Uncompressed usage by category:

Textures 299.5 mb (30%)

Meshes 0.0kb (0%)

...

Used Assets and files from the Resources folder, sorted by uncompressed size:

16.0 mb 1.6% Built-in Texture2D: sactx-2048x2048-Uncompressed-UIAtlas-312aba98

...

345.3 kb 0.1% Assets/Resources/UIAtlas/medal.png

... more entries like this ...

Please notice that this texture (medal.png), along with the other textures belongs to this atlas, which is already included in the build-executable.

I feel this is wrong. If I pack things, they should be packed into that texture and only that 2048x2048 texture should be in the build, right?

What's wrong here?

\$\endgroup\$
  • \$\begingroup\$ Does this still happen if you move the source file out of the Resources directory? \$\endgroup\$ – DMGregory May 18 at 23:00
  • 1
    \$\begingroup\$ Turned out that this is the issue. I found a post on Unity forums, made by one of the employees, explaining that any graphic in both the Resources folder and the SpriteAtlas will be duplicated. I'll find a link and put it here. Thanks, you were right ;) \$\endgroup\$ – Jacob May 19 at 7:26
  • 1
    \$\begingroup\$ Ooh, can you summarize that post as an answer here? \$\endgroup\$ – DMGregory May 19 at 7:27
0
\$\begingroup\$

Here's an official answer.

Any assets inside the Resources folder (including Sprites and Atlases regardless of being packed) will always be exported. This is by design.

So when we make a SpriteAtlas with some textures, and put in it the Resources folder, it's a total mess. I did it initially cause I wanted to unload assets and load them dynamically.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.