Hello Guest

Author Topic: Sprites keep disappearing in edit mode, reappears after recommit  (Read 16170 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #15 on: October 28, 2014, 05:24:49 pm »
Sorry no, I totally forgot to add it to the trello which I have now.
Add this to tk2dEditorUtility.cs to add the menu option

Code: [Select]

        [MenuItem(tk2dMenu.root + "Rebuild All Sprites", false, 10280)]
static void RebuildAllSprites() {
tk2dBaseSprite[] allSprites = Object.FindObjectsOfType(typeof(tk2dBaseSprite)) as tk2dBaseSprite[];
tk2dTextMesh[] allTextMeshes = Object.FindObjectsOfType(typeof(tk2dTextMesh)) as tk2dTextMesh[];
tk2dStaticSpriteBatcher[] allBatchers = Object.FindObjectsOfType(typeof(tk2dStaticSpriteBatcher)) as tk2dStaticSpriteBatcher[];
foreach (var t in allSprites) { t.ForceBuild(); }
foreach (var t in allTextMeshes) { t.ForceBuild(); }
foreach (var t in allBatchers) { t.ForceBuild(); }
}


Callabrator

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #16 on: November 03, 2014, 02:36:22 pm »
Much thanks for that menu fix!

Are there any plans to make a "proper" fix, that won't require using this menu tool?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #17 on: November 03, 2014, 11:53:20 pm »
Hi,

This doesn't happen for everyone, its because of what Unity have changed in their prefab system. Not sure if its a bug or not, to be honest.
In any case, I can think of a few workarounds to this, but I'd rather not implement them in the event Unity fixes it or reverts behaviour. Just waiting to see what happens in the next version.

NoradZero

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #18 on: January 14, 2015, 11:43:58 pm »
Im facing this issue on 4.6.0f1 after upgraded to FullInspector 2.5. I use the Rebuild sprites and it work but i have to do it each time i getting back in the scene from play mode. (Back in EditMode)

Probably nothing to do with FullInspector 2.5 but when i upgraded it look like to have triggered something in Unity which make prefab revert to MeshFilter = None each time which is rather strange.

Any ideas to fix this ? Any possible workarounds ?
« Last Edit: January 15, 2015, 01:27:34 am by NoradZero »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile