- Home /
Reloading Sprite Atlases from Asset Bundles
I'm having trouble reloading Sprite Atlases from Asset Bundles after they have already been loaded once.
I have a pretty heavy 2D game, with a lot of large sprites, so I would like to load them in and out of memory as you progress through different parts of the game. I'm trying to use Asset Bundles containing Sprite Atlases to achieve this, but I have a problem when I want to reload a Sprite Atlas that I had loaded previously.
Steps to reproduce my problem:
Subscribe to
SpriteAtlasManager.atlasRequested
for late binding of Sprite Atlases
When
atlasRequested
is called, load the requested a Sprite Atlas from an Asset Bundle. This works fine.
Now unload the Asset Bundle that was just loaded. The Sprite Atlas is unloaded with is and sprites disappear from the scene in Unity.
Now, how do I reload and rebind the Sprite Atlas? Can I somehow force the
SpriteAtlasManager
to callatlasRequested
again?
Does this make sense? Is it the right strategy to solving my problem? Any thoughts?
EDIT: I have had a look at this, which I think is doing what I want to do, but it seems like a pretty convoluted way to achieve something like this: https://github.com/jconstable/SpriteSleeper
Answer by MikePage_Artrix · Sep 07, 2019 at 07:56 AM
You can check out this thread. Seems like we're having the same issue.
https://forum.unity.com/threads/can-not-do-late-atlas-binding-after-reload-spriteatlas.736895/
Answer by as5405as · Jul 24, 2020 at 02:47 PM
@stalhandske are you get solution?
No, unfortunately nothing yet. I'd love to know if you find anything. At the moment I'm just loading the atlases and never unloading them.
Your answer
Follow this Question
Related Questions
Which sprite atlas goes into an asset bundle? 0 Answers
Using Sprite Atlas with Asset Bundle 0 Answers
Get a sprite's atlas during build 0 Answers
How to use Sprite Atlas with Assetbundles in WebGL? 1 Answer
If I use Sprite Atlas, will the images that are part of the atlas still be included in build? 1 Answer