Hello Guest

Author Topic: [BUG] GetDefaultSpriteCollection() and platform specifics  (Read 3515 times)

Goepfie

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
[BUG] GetDefaultSpriteCollection() and platform specifics
« 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.

  • Create a new project
  • Import tk2d
  • Delete _demo folder
  • Create only Sprite Collections with platform specifics
  • Recreate Index
  • No Collection found Error will appear

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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [BUG] GetDefaultSpriteCollection() and platform specifics
« Reply #1 on: March 13, 2013, 09:05:29 pm »
Thanks for the bug report. This will be fixed in the next release.