Hi,
I have a script that does something similar to the mix-match demo and adds/swaps attachments dynamically. This all works great, but I'd like to take it a step further and be able to have the attachments shown in the editor, but the SkeletonRendererInspector
seems to override the skeleton's skin every time my object is selected in the editor. Here is the code that overrides my skin:
if (!Application.isPlaying && Event.current.type == EventType.Layout) {
bool mismatchDetected = false;
if (multi) {
foreach (var o in targets)
mismatchDetected |= UpdateIfSkinMismatch((SkeletonRenderer)o);
} else {
mismatchDetected |= UpdateIfSkinMismatch(target as SkeletonRenderer);
}
if (mismatchDetected) {
mismatchDetected = false;
SceneView.RepaintAll();
}
}
I can comment out UpdateIfSkinMismatch
but I'm wondering if there is another way to get around this, maybe add my own inspector that updates the skin after the SkeletonRendererInspector
?
Any help would be greatly appreciated.
Thanks!