I use the same sprite in two sprites atlases for dynamic batching in different situations, but unity always uses the same (first) atlas. Because of this dynamic batching breaks in the second scenario. I dont want to import the same sprite twice and all the sprites in the same atlas is too big. Does anyone have an idea how to achieve dynamic batching in both situations?
First I import the sprite sheet (smoke animation) and cut it with the sprite editor (different smoke states as separate sprites). Then I use the sprites in my scene. After that I create a sprite atlas and add all sprites of the scene that should be batched together (smoke sprites, cactus sprite and so on). This works without any problems.
In a different situation I also need the smoke animation. Because of that I create a new sprite atlas (cannot use the first one, because of the size) and add the smoke sprites with some other. But batching doesn’t work here, because unity uses the wrong atlas for the smoke sprites: First the right atlas is chosen. Then unity switches the atlas because of the smoke sprites. After that unity uses the right atlas again.
I know that i could optimize the scene with a different order of the sprites. Nevertheless there is one extra draw call for the smoke animation.