Hello Guest

Author Topic: Changing the color of a tk2dClippedSprite causes stray mesh to be created  (Read 4013 times)

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
I'm tracking down stuff in the Profiler and noticed that something was creating unreferenced meshes in the Memory/Detailed/Not Saved/Mesh section.
These meshes don't seem to be ever get deleted.  I've traced it back to when I change the color of a tk2dClippedSprite with the statement theSprite.color = theColor
That in turn calls tk2dClippedSprite/UpdateColorsImpl(), which then calls Build(), and in Build() it seems is where the stray mesh is created.

I know tk2dClippedSprite is the culprit because in the Build() function of the tk2dClippedSprite I did a test with mesh.name = "Stray Mesh";  and the Profiler
showed extra stray meshes that never get deleted with those names being created every time I entered my scene.

Any ideas?  I'm on Unity 4.7.2. and 2d Toolkit 2.5.0.  Thanks.

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Ok - I was able to fix this problem by starting the scene with the tk2ClippedSprite in the Unity editor checked on to be visible/active.   The problem was happening when the scene started with it off/invisible.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
I'll investigate this, it shouldn't exist if it is not visible / active.