SpriteAtlas preview not showing in inspector

Hi,

There is an annoying bug on the SpriteAtlas inspector, the sprite atlas preview is not showing at the bottom of the inspector.

The only way I found to see it is to change a setting, click on Pack Preview then rewind the settings has they need to be and re click on Pack Preview.

My project is using Unity 6.0.35 and SpriteAtlasV2.
On an other project using Unity 2022.3 and SpriteAtlas V1, there is no problem.

I sent a bug report about it: IN-94119

Are you sure it’s not hidden at the bottom?


Click on that double line if that’s the case

And make a screenshot of what your inspector shows there, it would help for sure

unfortunately there’s noting here:

The bug appear when using SpriteAtlas V2 and the SpriteAtlasMode is not set to SpriteAtlasV2 - Enabled.
So when it’s set to BuildOnly, you can’t see your atlases xD.

Please note that SpriteAtlasMode should be set to SpriteAtlasV2 - Enabled if previews need to be seen at all times.

SpriteAtlasV2 - Enabled always packs SpriteAtlas whenever there is a change.
BuildOnly Mode only packs/builds SpriteAtlas on Building Players/AssetBundles/etc…

This is a regression from the behavior of the SpriteAtlas V1. In V1 it was possible to see SpriteAtlas preview once packed even if we are in BuildOnly mode or Disabled.

On my game I have lot of atlas and 4 variants of each.
When SpriteAtlas is enabled every time an asset is modified, a sprite packing occurs, ant it can be pretty long… Most of times I make changes but don’t want to re-trigger a sprite pack directly, I want to be able to change multiple files one by one and then once finished trigger the sprite packing.

So I made a script that set the Sprite Packing to BuildOnly when not playing and to Enabled when I start playing, so it trigger the sprite packing when entering play mode if needed. (Like with SpriteAtlasV1)

This way I can work on my sprite files without loosing time with sprite packing.

But now I have this problem that I can not see my packed sprites. Why can I see them in V1 but not in v2 ? If they are packed, just show them. I can understand to not show them if it’s set to Disabled, but “Build Time Only” means I use/need it no ?

Sprite Atlas V2 differs from V1 in that the packed textures are now stored in AssetDatabase (instead of a custom AtlasCache folder) and imported data is consistent with the settings in Editor properties. There are quite a few advantages using AssetDatabase.

Both V1 and V2 do not pack SpriteAtlas even if there is a change in the data unless PackPreview is invoked.

However in V1 since a custom cache folder is used, preview was displayed from the last packed state, not the active state. In V2, this is controlled by AssetDatabase and preview is consistent with the settings of ImportMode (Enabled vs BuildOnly).

If you would like to do the same for V2, you may want to write a script to toggle between the Enabled and BuildOnly state ? (because you are packing them before entering playmode anyway). Please let us know if this helps.

No, the problem is that with V2, the sprite packing is fired directly after an asset change instead of waiting to enter playmode (as it was with v1). So if you want to change for example the pivot of 50 sprites (that can’t be done in one time as the sprite editor doesn’t work with multiple selection), you will have 50 sprite packing… This is the same when you add files in the project, rename files, move files…

I Understand the benefits for the V2, but you have to admit that this behavior is a waste of time.

So I think that in BuildOnly, the preview should be shown.
Or at least make the v2 work like the v1 and don’t fire the sprite packing at every change.