mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Merge branch '4.0' into 4.1-beta
This commit is contained in:
commit
8a83d9aabe
@ -110,6 +110,7 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
public static bool SetupSpinePrefabMesh(GameObject g, UnityEditor.AssetImporters.AssetImportContext context)
|
public static bool SetupSpinePrefabMesh(GameObject g, UnityEditor.AssetImporters.AssetImportContext context)
|
||||||
{
|
{
|
||||||
|
Dictionary<string, int> nameUsageCount = new Dictionary<string, int>();
|
||||||
bool wasModified = false;
|
bool wasModified = false;
|
||||||
var skeletonRenderers = g.GetComponentsInChildren<SkeletonRenderer>(true);
|
var skeletonRenderers = g.GetComponentsInChildren<SkeletonRenderer>(true);
|
||||||
foreach (SkeletonRenderer renderer in skeletonRenderers) {
|
foreach (SkeletonRenderer renderer in skeletonRenderers) {
|
||||||
@ -125,6 +126,12 @@ namespace Spine.Unity.Editor {
|
|||||||
if (mesh == null) continue;
|
if (mesh == null) continue;
|
||||||
|
|
||||||
string meshName = string.Format("Skeleton Prefab Mesh \"{0}\"", renderer.name);
|
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.name = meshName;
|
||||||
mesh.hideFlags = HideFlags.None;
|
mesh.hideFlags = HideFlags.None;
|
||||||
if (context != null)
|
if (context != null)
|
||||||
|
|||||||
@ -476,6 +476,11 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
this.rectTransform.sizeDelta = size;
|
this.rectTransform.sizeDelta = size;
|
||||||
this.rectTransform.pivot = p;
|
this.rectTransform.pivot = p;
|
||||||
|
|
||||||
|
foreach (var submeshGraphic in submeshGraphics) {
|
||||||
|
submeshGraphic.rectTransform.sizeDelta = size;
|
||||||
|
submeshGraphic.rectTransform.pivot = p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event UpdateBonesDelegate BeforeApply;
|
public event UpdateBonesDelegate BeforeApply;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user