2D Toolkit Forum

2D Toolkit => Support => Topic started by: ds85 on March 19, 2016, 06:45:25 am

Title: Black Sprites after using UnloadTextures on Sprite Collection Data
Post by: ds85 on March 19, 2016, 06:45:25 am
Hi,

Facing this issue in Unity 5.3.3.
After level loading i am preloading all the sprite collections used in scene,so as to avoid sudden large spikes during instantiating sprites.

tk2dSpriteCollectionData spriteCollection = tk2dSystem.LoadResourceByName<tk2dSpriteCollectionData>("Name")

Now after level ends in order to unload atlas textures i am giving call to :

spriteCollection.UnloadTextures();
spriteCollection.ResetPlatformData();

All the atlas are unloaded from memory as expected.

But now after reloading the level and following the above steps all the sprites appear as completely black textured.They didn't reload their texture and material information. :'(
Kindly suggest how i can rectify this issue.

Thanks,
DS
Title: Re: Black Sprites after using UnloadTextures on Sprite Collection Data
Post by: unikronsoftware on March 27, 2016, 02:52:49 pm
Hi there,

Unity's meant to reload the texture when its used again (according to the docs) but it doesn't do it on textures for some reason. You can force it to do it by doing something like this - http://2dtoolkit.com/forum/index.php/topic,2101.msg14857.html#msg14857