Hello Guest

Author Topic: tk2dSpriteCollection atlas corruption issues  (Read 3346 times)

richicon

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
tk2dSpriteCollection atlas corruption issues
« on: May 02, 2014, 05:53:13 pm »
Hi
I'm using tilemaps and tk2dSpriteCollection, however every now and then after modifying some of the source images it creates another tk2dSpriteCollectionData.
and sometimes after that it doesn't reference the atlas correctly and shows the wrong graphics for all the tiles. (and all the diced sprites are totally messed up).

no amount of re-indexing, conmiting etc fixes it.

the only way I've found to fix it is to revert the sprite collection and data directory to before it went wrong and let it have another go at updating the collection/atlas.

this is happening quite a lot now, probably because our artists are making lots of changes.

as far as I can tell, its creating another tk2dSpriteCollectionData, possibly with the correct references, but then still referencing an old one, or visa versa.

I did try deleting the newly created sprite datas, but that didn't really help.

deleting all the instances tk2dSpriteCollectionData did fix the messed up sprite issues, but destroyed all the animations we had that references the sprite collection.

any idea whats happening, or what we can do about it.
thanks
Rich






unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dSpriteCollection atlas corruption issues
« Reply #1 on: May 03, 2014, 08:06:17 pm »
Hi this is probably one of 2 things -

1. The sprite collection object itself is broken and lost the reference to the sprite collection data object. Click on the sprite collection, go into debug inspector mode and make sure the data object is linked to the "Sprite Collection" field. If it isnt, just drag it back in and switch back to normal mode. It will be fixed in subsequent commits.

2. There is a long standing very rare Unity bug which was reported a long time ago where something breaks in Unity and prefabs stop working properly from that point on. Bug #526960, which was confirmed reproducible by Unity in Feb 2013 and thats the last I've heard of it :( The only reported way I've heard of that fixes this is - create a new unity project, export the previous project into a unitypacakge and reimport into this new project, but I haven't verified this. I've only seen one reproducible case of this.