Okay, so I spent the better part of my day hacking the SkeletonUtilitySubmeshRenderer.cs script. Disabling the two lines
cachedRenderer.sortingLayerID = sortingLayerID;
cachedRenderer.sortingOrder = sortingOrder;
lets me modify the Sorting Layers for the Mesh Renderers again.
Unfortunately, it all seems buggy as hell.
Is there any explanation written on how to actually use this Submesh Separator feature in the runtime?
All I could find was 1/2 a forum post by Mitch (who, apparently, wrote it in the first place).
@[gelöscht]: Could you enlighten me how to correctly use the Submesh Separators? I really need the feature to put stuff between my animated sprites (it's essential for my gameplay)
EDIT: What seems to be the most troubling is the "random" enabling/disabling of the Parent-Mesh and the Submeshes.
E.g. every time I playtest the Scene, then stop and return to the Scene View, ALL the meshes (parent and submeshes) turn off. The whole Animation "disappears". I can manually turn the renderer components on again but this is basically unusable right now.
Update: I have spent the rest of the day digging into the SkeletonUtilitySubmeshRenderer.cs script. Here's what I found out:
I could (seemingly) solve my Sorting Layer problems by changing the script accessing the SortingLayerName instead of SortingLayerID. Maybe SortingLayerID doesn't work anymore in Unity5?
Anways, by referring to Name instead of ID and changing the script accordingly, I managed to get the Submesh Layering working again.
Another problem showed its ugly head though and I just can't get it to go away:
Whenever I test the scene in Play Mode, stop and go back to Scene View (Editor Mode), my Submeshes disappear!
This seems to happen because the Meshes seem to get RESET but NOT REBUILT. [ExecuteInEditMode] only triggers after I change something in the scene (for example change x-coordinates of the object, set a checkbox etc.) and this succesfully rebuilds the submeshes.
I already tried to make the script rebuild the meshes in Edit Mode but to no avail ( [InitializeOnLoading] doesn't seem to help either)
Yeah, so, there goes my day trying to figure out this thing. Hope I could someone out a bit and I would love to see this fixed.
Thanks for reading! 🙂