Hello Guest

Author Topic: Black Sprites after using UnloadTextures on Sprite Collection Data  (Read 3638 times)

ds85

  • Newbie
  • *
  • Posts: 2
    • View Profile
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
« Last Edit: March 19, 2016, 07:42:44 am by ds85 »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Black Sprites after using UnloadTextures on Sprite Collection Data
« Reply #1 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