Handful of sprites don't seem to be getting referenced from the atlas

Hi,

All our UI sprites have packing tags specified and so are packed into various atlases. However I have noticed when profiling that there are small number (perhaps half a dozen out of several hundred) that appear in the profiler as individual sprites rather than as part of the atlas:

In this case HC_Element_Wheel_01 should be part of the the FrontEnd atlas - here are its import settings:

2345558--158714--upload_2015-10-19_17-57-40.png

And if I look at the atlas I can see the sprite is being included:

2345558--158715--upload_2015-10-19_17-58-21.png

One funny thing however is if I click on the sprite asset under the texture asset unity does not jump to the appropriate page on the atlas that the sprite is on:

2345558--158716--upload_2015-10-19_17-59-3.png

This pattern seems to hold true for all the sprites which appear in the profiler as not part of an atlas (and this works correctly for the sprites that do show up as atlased in the profiler). I have tried to delete the atlas cache in case there was some wonky data in there to no avail.

Does anyone have any idea what might be going on here? I’m scratching my head a little here…

When you build your game, does the editor build log also list those sprite assets (e.g: include those assets out of the atlas) ?

It does indeed.

Did you find anything else interesting that’s related to all of these “stray” textures? for example, anything different about their import settings? Do they have any overrides for a particular platform? any different settings? is the packing tag spelled correctly without any extra chars, etc?

So digging a bit deeper it seems that completely closing the editor and cleaning the atlas cache does help for the first build:

Textures 68.5 mb 56.8%
Meshes 3.3 mb 2.7%
Animations 704.7 kb 0.6%
Sounds 13.4 mb 11.1%
Shaders 971.2 kb 0.8%
Other Assets 13.4 mb 11.1%
Levels 5.1 mb 4.2%
Scripts 7.3 mb 6.1%
Included DLLs 6.4 mb 5.3%
File headers 1.5 mb 1.2%
Complete size 120.5 mb 100.0%

but then subsequently sprites that were atlased start appearing ‘loose’ in the build and the size increases:

Textures 83.7 mb 61.7%
Meshes 3.3 mb 2.4%
Animations 704.7 kb 0.5%
Sounds 13.4 mb 9.8%
Shaders 971.2 kb 0.7%
Other Assets 13.4 mb 9.9%
Levels 5.1 mb 3.8%
Scripts 7.3 mb 5.4%
Included DLLs 6.4 mb 4.7%
File headers 1.5 mb 1.1%
Complete size 135.7 mb 100.0%

So while I have made a bit of progress I still have no idea how/why things are going awry (but the fact it does work sometimes suggests that the problem doesnt lie within my assets but within the build process itself)

Do you have any other system in place that uses these sprites? or that uses those textures in any complicated way that may be including them into the build ?

They are definitely being referenced and I expect them to be in the build (but atlased) - some of our atlases are referenced by assets that are part of asset bundles but these arent the ones that seem to be going wrong, those ones are just UI textures referenced either by prefabs or included in a scene.

On the first build after clearing the atlas cache they are, but on subsequent builds thing go wrong and they get included as ‘loose’ textures. Really weird…