- Home /
Get a sprite's atlas during build
Hello,
I have a ScriptableObject ("Variants") that contains Sprites as subassets, which are variants of an existing sprite ("Original"). Sans titre.png The goal is to have multiple sprites pointing at a same texture.
However, I encounter a problem when using SpriteAtlases, as I need to rebuild the variants when the "Original" sprite is packed:
When entering play mode the original sprite is automatically changed to use the spriteAtlas instead of the original texture. So when entering play mode, my variants regenerate themselves in order to use the spriteAtlas as well.
When quitting play mode, my variants go back to the original texture.
When building, the variants should use the spriteAtlas again. However, my variants do not regenerate, and are still using the original texture.
How could I make it so that the variants use the atlas instead of the original texture when building?
My guess is that I would need a callback that happens after the sprites are packed, but before the resources are built.
Thank you
Your answer
Follow this Question
Related Questions
Why is atlas and individual sprites included in package? 0 Answers
If I use Sprite Atlas, will the images that are part of the atlas still be included in build? 1 Answer
Reloading Sprite Atlases from Asset Bundles 2 Answers
Which sprite atlas goes into an asset bundle? 0 Answers
Distribute terrain in zones 3 Answers