Hello Guest

Author Topic: tk2dslicesprite bug: created in hieracrchy vs. added to existing GameObject  (Read 3999 times)

lazypeon

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Either a bug, or I'm missing something... not sure.

Compare the following cases:
1. In Hierarchy, create >  tk2d > Slice Sprite (this works fine)

2. Take an existing Game Object.  Component > 2D Toolkit > Sprite > tk2dslicesprite.

In case #2, checking the 'box collider' option creates a box collider of 0 size (as opposed to case #1, where the box collider is synced with the size of the sliced sprite).  Additionally, the 'anchor' dropdown is missing in case #2.

Has anyone observed this before? 

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Its not a bug - its a versioning hack to do with backwards compatibility in Unity.
Theres a version flag in there that tells the sliced sprite what version it is. It defaults to 0 for backwards compatibility, but it really needs to be 1 for normal use (which the Create > tk2d > Sliced Sprite menu does).

If you switch the inspector to debug mode, then turn off legacy mode and switch back, it should then work as expected. If creating from code, set legacyMode = false, and that will then work as expected.

In any case, there is a fixed automatic upgrade path in 2D Toolkit 2.0, and it should behave correctly in there.

lazypeon

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Oh, great, good to know!  I've been recreating my Game Objects when this happened before.

Your support continues to be absolutely amazing -- GREATLY appreciated!