diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs index 5f33fd694..22139dd1c 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs @@ -110,6 +110,7 @@ namespace Spine.Unity.Editor { public static bool SetupSpinePrefabMesh(GameObject g, UnityEditor.AssetImporters.AssetImportContext context) { + Dictionary nameUsageCount = new Dictionary(); bool wasModified = false; var skeletonRenderers = g.GetComponentsInChildren(true); foreach (SkeletonRenderer renderer in skeletonRenderers) { @@ -125,6 +126,12 @@ namespace Spine.Unity.Editor { if (mesh == null) continue; string meshName = string.Format("Skeleton Prefab Mesh \"{0}\"", renderer.name); + if (nameUsageCount.ContainsKey(meshName)) { + nameUsageCount[meshName]++; + meshName = string.Format("Skeleton Prefab Mesh \"{0} ({1})\"", renderer.name, nameUsageCount[meshName]); + } else { + nameUsageCount.Add(meshName, 0); + } mesh.name = meshName; mesh.hideFlags = HideFlags.None; if (context != null) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs index e55eb58d4..8a25f4607 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs @@ -476,6 +476,11 @@ namespace Spine.Unity { this.rectTransform.sizeDelta = size; this.rectTransform.pivot = p; + + foreach (var submeshGraphic in submeshGraphics) { + submeshGraphic.rectTransform.sizeDelta = size; + submeshGraphic.rectTransform.pivot = p; + } } public event UpdateBonesDelegate BeforeApply;