2D Toolkit Forum

2D Toolkit => Support => Topic started by: Goepfie on March 13, 2013, 03:23:38 pm

Title: [BUG] GetDefaultSpriteCollection() and platform specifics
Post by: Goepfie on March 13, 2013, 03:23:38 pm
Hey,

I found an reproducible bug, that can prevent you from creating a new animation clip or sprite based game objects in a scene.


What happens:
tk2dSpriteGuiUtility.GetDefaultSpriteCollection() will be evoked but returns null, because of the exceptions while iterating through the tk2d index.
Code: [Select]
if (!indexEntry.managedSpriteCollection && indexEntry.spriteNames != null)The reference collection is a not managed but does not contain spriteNames. The platform specifics is managed and contains names.

Further tk2dSpriteAnimationClip.CreateNewClip() does not validate a null return and will throw an Editor-Error
Code: [Select]
clip.frames[0].spriteCollection = tk2dSpriteGuiUtility.GetDefaultSpriteCollection();
My current workaround is to create a decoy SpriteCollection with only one sprite.

If needed I could attach my Editor Debug Log for reference.
Title: Re: [BUG] GetDefaultSpriteCollection() and platform specifics
Post by: unikronsoftware on March 13, 2013, 09:05:29 pm
Thanks for the bug report. This will be fixed in the next release.