From 1306384a8cffe986d26b4121ca9b5f41c852b181 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sun, 27 Apr 2014 13:21:17 +0200 Subject: [PATCH] Immutable triangles optimization, better inspectors. --- .../Editor/SkeletonAnimationInspector.cs | 39 ++++-------------- .../Spine/Editor/SkeletonRendererInspector.cs | 34 +++++++++++---- spine-tk2d/Assets/Spine/SkeletonAnimation.cs | 5 ++- spine-tk2d/Assets/Spine/SkeletonRenderer.cs | 39 +++++++++++------- .../Assets/examples/goblins/goblins.unity | Bin 20384 -> 20440 bytes .../Assets/examples/spineboy/spineboy.unity | Bin 23584 -> 23624 bytes .../Editor/SkeletonAnimationInspector.cs | 39 ++++-------------- .../Spine/Editor/SkeletonRendererInspector.cs | 34 +++++++++++---- spine-unity/Assets/Spine/SkeletonAnimation.cs | 5 ++- spine-unity/Assets/Spine/SkeletonRenderer.cs | 37 ++++++++++------- .../Assets/examples/dragon/dragon.unity | Bin 20504 -> 20568 bytes .../{goblins.mat => goblins Material.mat} | Bin 4416 -> 4424 bytes ...ins.mat.meta => goblins Material.mat.meta} | 0 .../Assets/examples/goblins/goblins.unity | Bin 21000 -> 21056 bytes .../Assets/examples/spineboy/spineboy.unity | Bin 20624 -> 20680 bytes 15 files changed, 119 insertions(+), 113 deletions(-) rename spine-unity/Assets/examples/goblins/{goblins.mat => goblins Material.mat} (92%) rename spine-unity/Assets/examples/goblins/{goblins.mat.meta => goblins Material.mat.meta} (100%) diff --git a/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs b/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs index 0ca0e6dd1..1574b3cdc 100644 --- a/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs +++ b/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs @@ -47,29 +47,10 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { base.gui(); SkeletonAnimation component = (SkeletonAnimation)target; + if (!component.valid) return; - EditorGUILayout.PropertyField(skeletonDataAsset); - - if (component.valid) { - // Initial skin name. - String[] skins = new String[component.skeleton.Data.Skins.Count]; - int skinIndex = 0; - for (int i = 0; i < skins.Length; i++) { - String name = component.skeleton.Data.Skins[i].Name; - skins[i] = name; - if (name == initialSkinName.stringValue) - skinIndex = i; - } - - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Initial Skin"); - EditorGUIUtility.LookLikeControls(); - skinIndex = EditorGUILayout.Popup(skinIndex, skins); - EditorGUILayout.EndHorizontal(); - - initialSkinName.stringValue = skins[skinIndex]; - - // Animation name. + // Animation name. + { String[] animations = new String[component.skeleton.Data.Animations.Count + 1]; animations[0] = ""; int animationIndex = 0; @@ -81,19 +62,15 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { } EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Animation"); - EditorGUIUtility.LookLikeControls(); + EditorGUILayout.LabelField("Animation", GUILayout.Width(EditorGUIUtility.labelWidth)); animationIndex = EditorGUILayout.Popup(animationIndex, animations); EditorGUILayout.EndHorizontal(); - component.animationName = animationIndex == 0 ? null : animations[animationIndex]; - animationName.stringValue = component.animationName; + String selectedAnimationName = animationIndex == 0 ? null : animations[animationIndex]; + component.AnimationName = selectedAnimationName; + animationName.stringValue = selectedAnimationName; } - // Animation loop. - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Loop"); - loop.boolValue = EditorGUILayout.Toggle(loop.boolValue); - EditorGUILayout.EndHorizontal(); + EditorGUILayout.PropertyField(loop); } } diff --git a/spine-tk2d/Assets/Spine/Editor/SkeletonRendererInspector.cs b/spine-tk2d/Assets/Spine/Editor/SkeletonRendererInspector.cs index eee9ca031..701400766 100644 --- a/spine-tk2d/Assets/Spine/Editor/SkeletonRendererInspector.cs +++ b/spine-tk2d/Assets/Spine/Editor/SkeletonRendererInspector.cs @@ -34,7 +34,7 @@ using UnityEngine; [CustomEditor(typeof(SkeletonRenderer))] public class SkeletonRendererInspector : Editor { - protected SerializedProperty skeletonDataAsset, initialSkinName, normals, tangents, meshes; + protected SerializedProperty skeletonDataAsset, initialSkinName, normals, tangents, meshes, immutableTriangles; protected virtual void OnEnable () { skeletonDataAsset = serializedObject.FindProperty("skeletonDataAsset"); @@ -42,15 +42,29 @@ public class SkeletonRendererInspector : Editor { normals = serializedObject.FindProperty("calculateNormals"); tangents = serializedObject.FindProperty("calculateTangents"); meshes = serializedObject.FindProperty("renderMeshes"); + immutableTriangles = serializedObject.FindProperty("immutableTriangles"); } protected virtual void gui () { - SkeletonRenderer component = (SkeletonRenderer)target; - EditorGUILayout.PropertyField(skeletonDataAsset); - - if (component.valid) { - // Initial skin name. + + SkeletonRenderer component = (SkeletonRenderer)target; + if (!component.valid) { + component.Reset(); + component.LateUpdate(); + if (!component.valid) { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.Space(); + if (GUILayout.Button("Refresh")) component.Reset(); + EditorGUILayout.Space(); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + return; + } + } + + // Initial skin name. + { String[] skins = new String[component.skeleton.Data.Skins.Count]; int skinIndex = 0; for (int i = 0; i < skins.Length; i++) { @@ -61,15 +75,17 @@ public class SkeletonRendererInspector : Editor { } EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Initial Skin"); - EditorGUIUtility.LookLikeControls(); + EditorGUILayout.LabelField("Initial Skin", GUILayout.Width(EditorGUIUtility.labelWidth)); skinIndex = EditorGUILayout.Popup(skinIndex, skins); EditorGUILayout.EndHorizontal(); initialSkinName.stringValue = skins[skinIndex]; } - EditorGUILayout.PropertyField(meshes); + EditorGUILayout.PropertyField(meshes, + new GUIContent("Render Meshes", "Disable to optimize rendering for skeletons that don't use meshes")); + EditorGUILayout.PropertyField(immutableTriangles, + new GUIContent("Immutable Triangles", "Enable to optimize rendering for skeletons that never change attachment visbility")); EditorGUILayout.PropertyField(normals); EditorGUILayout.PropertyField(tangents); } diff --git a/spine-tk2d/Assets/Spine/SkeletonAnimation.cs b/spine-tk2d/Assets/Spine/SkeletonAnimation.cs index 63a4be1a5..cb490af27 100644 --- a/spine-tk2d/Assets/Spine/SkeletonAnimation.cs +++ b/spine-tk2d/Assets/Spine/SkeletonAnimation.cs @@ -44,8 +44,9 @@ public class SkeletonAnimation : SkeletonRenderer { public delegate void UpdateBonesDelegate(SkeletonAnimation skeleton); public UpdateBonesDelegate UpdateBones; - public String _animationName; - public String animationName { + [SerializeField] + private String _animationName; + public String AnimationName { get { TrackEntry entry = state.GetCurrent(0); return entry == null ? null : entry.Animation.Name; diff --git a/spine-tk2d/Assets/Spine/SkeletonRenderer.cs b/spine-tk2d/Assets/Spine/SkeletonRenderer.cs index 86d027e36..2c78c67c4 100644 --- a/spine-tk2d/Assets/Spine/SkeletonRenderer.cs +++ b/spine-tk2d/Assets/Spine/SkeletonRenderer.cs @@ -44,10 +44,9 @@ public class SkeletonRenderer : MonoBehaviour { public SkeletonDataAsset skeletonDataAsset; public String initialSkinName; - public bool calculateNormals; - public bool calculateTangents; + public bool calculateNormals, calculateTangents; public float zSpacing; - public bool renderMeshes; + public bool renderMeshes = true, immutableTriangles; private MeshFilter meshFilter; private Mesh mesh, mesh1, mesh2; @@ -60,8 +59,7 @@ public class SkeletonRenderer : MonoBehaviour { private Material[] sharedMaterials = new Material[0]; private readonly List submeshMaterials = new List(); private readonly List submeshes = new List(); - private readonly int[] quadTriangles = {0, 2, 1, 2, 3, 1}; - + public virtual void Reset () { if (meshFilter != null) meshFilter.sharedMesh = null; if (mesh != null) DestroyImmediate(mesh); @@ -111,7 +109,7 @@ public class SkeletonRenderer : MonoBehaviour { public virtual void LateUpdate () { if (!valid) return; - + // Count vertices and submesh triangles. int vertexCount = 0; int submeshTriangleCount = 0, submeshFirstVertex = 0, submeshStartSlotIndex = 0; @@ -280,8 +278,7 @@ public class SkeletonRenderer : MonoBehaviour { mesh.subMeshCount = submeshCount; for (int i = 0; i < submeshCount; ++i) mesh.SetTriangles(submeshes[i].triangles, i); - mesh.RecalculateBounds(); - + if (newTriangles && calculateNormals) { Vector3[] normals = new Vector3[vertexCount]; Vector3 normal = new Vector3(0, 0, -1); @@ -309,7 +306,11 @@ public class SkeletonRenderer : MonoBehaviour { int submeshIndex = submeshMaterials.Count; submeshMaterials.Add(material); - if (submeshes.Count <= submeshIndex) submeshes.Add(new Submesh()); + if (submeshes.Count <= submeshIndex) + submeshes.Add(new Submesh()); + else if (immutableTriangles) + return; + Submesh submesh = submeshes[submeshIndex]; int[] triangles = submesh.triangles; @@ -346,12 +347,20 @@ public class SkeletonRenderer : MonoBehaviour { List drawOrder = skeleton.DrawOrder; for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) { Attachment attachment = drawOrder[i].attachment; + if (attachment is RegionAttachment) { + triangles[triangleIndex] = firstVertex; + triangles[triangleIndex + 1] = firstVertex + 2; + triangles[triangleIndex + 2] = firstVertex + 1; + triangles[triangleIndex + 3] = firstVertex + 2; + triangles[triangleIndex + 4] = firstVertex + 3; + triangles[triangleIndex + 5] = firstVertex + 1; + triangleIndex += 6; + firstVertex += 4; + continue; + } int[] attachmentTriangles; int attachmentVertexCount; - if (attachment is RegionAttachment) { - attachmentVertexCount = 4; - attachmentTriangles = quadTriangles; - } else if (attachment is MeshAttachment) { + if (attachment is MeshAttachment) { MeshAttachment meshAttachment = (MeshAttachment)attachment; attachmentVertexCount = meshAttachment.vertices.Length >> 1; attachmentTriangles = meshAttachment.triangles; @@ -376,8 +385,8 @@ public class SkeletonRenderer : MonoBehaviour { Vector3 min = new Vector3(float.MaxValue, float.MaxValue, 0f); Vector3 max = new Vector3(float.MinValue, float.MinValue, 0f); foreach (Vector3 vert in vertices) { - min = Vector3.Min (min, vert); - max = Vector3.Max (max, vert); + min = Vector3.Min(min, vert); + max = Vector3.Max(max, vert); } float width = max.x - min.x; float height = max.y - min.y; diff --git a/spine-tk2d/Assets/examples/goblins/goblins.unity b/spine-tk2d/Assets/examples/goblins/goblins.unity index f1c441262270f2872d75acd78ba40b89cfe9533f..1774f0ba316858a2d1d3d3387ac24ee8015e8fc0 100644 GIT binary patch delta 271 zcmZ25pYg_gMgax}4-Eze{~HVp44go=!$bjlM&ZqZD#sZouh-PrY|pfbd2&80n?z=A zZfQwkQch|}QD$OZdQNIF10zt6^5lE0>WnIr8FhsxOS17Zs!rBq(`8hf9L}c9s6M%x zO@UEk@*FlrM$OIp*gn|{<^Z+)2ZACXeNH|+U1Rb=H(}cjRt5$Ypok(AUjWK%0Ez_w z`7BV(p?^P{fsKKo637Qx48oj1v4+Wl?!uZ6fHDq15l1NI2FfU~qngSC6!Vzu>waai Zk_YQ#IbW^G6FgWZKk#AQ?CTrM1OQwmKIQ-b delta 270 zcmcaHpK-x_Mgax}_wNi0{tFlw7&sXiJOm~R*l$i2KfyTpfu_b}17ZHneoTv*C(mbP zo2bTS6$bg%bHo(KY^VtO*8>_Zv0#kqu_bttI9$rIWzbEdf&NoCT+C%a*Jz>Wf)@< zBe->;jy}+a-IzAQX+HA89qo9@DRjh7XO%eD>1oj5VY;jK($&N^IyV@kh7zFlU_hNJ zI@V~eV6hEc5qhWe^F4G*jq<(T_@H0q`$Xkl@f(Vp+`Ym7c;5~l{*QNr|J&{u-%m|7 z!K1XQ4)8vDezI3L&pVYQD_hQWt9;R#xna#Pj%+auhV^`*aI2D=vaRuQKIcr^^2dIh z4~HuGf_3Ry&bF9>1BP(Ze!1DjV##wkK$*}{KH%j$=;e$5&UeVm_boI%T(xmte26lh z58o~rbszjt_el|03v3eoE~!UgIu>Wqi~T~6!AdAjpk9}LPr#mmrNB;0Exef_2UV%BNcSwB&OLcAz(wSJfSqHm= z86@`91*YLYJedS&f7Y#lCBPI|J4rWK6YTFKJz%eC=h%0e&-A$4GiQ91HDib-E}Avt U;ELNY$2(~4@^P<;XV-i`0n~%UlmGw# delta 837 zcma))PiPZS5XR><8gX4-K_#f-$WU1ho)P zHPKTX|J=0Ra?-+r^dfl7(W9XF=N`3s@}So5EiYgXiVGh*^Lz7V-nVaCTVi8N1c@?j zqPZv$brWT&5lo35ZcN4<0Uz&-_VP`{g9#ruwU8L#7g|gV@<%PoF>i?5hAxh9Z=%nc@S2*l5^eqe zv{>NuKc+noME*XF&*>3q%fhGOBjrdQ#zgPpih8j3_)eYvyuRNaw z=zP|_fCa!bSjWjeuqN1_PI|yz@$t+LXDoZxBLrWzhxw5mXKQvpKh7R>w(Zd_;Bao- Jv2x!%zX55xyZrzF diff --git a/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs b/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs index 0ca0e6dd1..1574b3cdc 100644 --- a/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs +++ b/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs @@ -47,29 +47,10 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { base.gui(); SkeletonAnimation component = (SkeletonAnimation)target; + if (!component.valid) return; - EditorGUILayout.PropertyField(skeletonDataAsset); - - if (component.valid) { - // Initial skin name. - String[] skins = new String[component.skeleton.Data.Skins.Count]; - int skinIndex = 0; - for (int i = 0; i < skins.Length; i++) { - String name = component.skeleton.Data.Skins[i].Name; - skins[i] = name; - if (name == initialSkinName.stringValue) - skinIndex = i; - } - - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Initial Skin"); - EditorGUIUtility.LookLikeControls(); - skinIndex = EditorGUILayout.Popup(skinIndex, skins); - EditorGUILayout.EndHorizontal(); - - initialSkinName.stringValue = skins[skinIndex]; - - // Animation name. + // Animation name. + { String[] animations = new String[component.skeleton.Data.Animations.Count + 1]; animations[0] = ""; int animationIndex = 0; @@ -81,19 +62,15 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { } EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Animation"); - EditorGUIUtility.LookLikeControls(); + EditorGUILayout.LabelField("Animation", GUILayout.Width(EditorGUIUtility.labelWidth)); animationIndex = EditorGUILayout.Popup(animationIndex, animations); EditorGUILayout.EndHorizontal(); - component.animationName = animationIndex == 0 ? null : animations[animationIndex]; - animationName.stringValue = component.animationName; + String selectedAnimationName = animationIndex == 0 ? null : animations[animationIndex]; + component.AnimationName = selectedAnimationName; + animationName.stringValue = selectedAnimationName; } - // Animation loop. - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Loop"); - loop.boolValue = EditorGUILayout.Toggle(loop.boolValue); - EditorGUILayout.EndHorizontal(); + EditorGUILayout.PropertyField(loop); } } diff --git a/spine-unity/Assets/Spine/Editor/SkeletonRendererInspector.cs b/spine-unity/Assets/Spine/Editor/SkeletonRendererInspector.cs index eee9ca031..701400766 100644 --- a/spine-unity/Assets/Spine/Editor/SkeletonRendererInspector.cs +++ b/spine-unity/Assets/Spine/Editor/SkeletonRendererInspector.cs @@ -34,7 +34,7 @@ using UnityEngine; [CustomEditor(typeof(SkeletonRenderer))] public class SkeletonRendererInspector : Editor { - protected SerializedProperty skeletonDataAsset, initialSkinName, normals, tangents, meshes; + protected SerializedProperty skeletonDataAsset, initialSkinName, normals, tangents, meshes, immutableTriangles; protected virtual void OnEnable () { skeletonDataAsset = serializedObject.FindProperty("skeletonDataAsset"); @@ -42,15 +42,29 @@ public class SkeletonRendererInspector : Editor { normals = serializedObject.FindProperty("calculateNormals"); tangents = serializedObject.FindProperty("calculateTangents"); meshes = serializedObject.FindProperty("renderMeshes"); + immutableTriangles = serializedObject.FindProperty("immutableTriangles"); } protected virtual void gui () { - SkeletonRenderer component = (SkeletonRenderer)target; - EditorGUILayout.PropertyField(skeletonDataAsset); - - if (component.valid) { - // Initial skin name. + + SkeletonRenderer component = (SkeletonRenderer)target; + if (!component.valid) { + component.Reset(); + component.LateUpdate(); + if (!component.valid) { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.Space(); + if (GUILayout.Button("Refresh")) component.Reset(); + EditorGUILayout.Space(); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + return; + } + } + + // Initial skin name. + { String[] skins = new String[component.skeleton.Data.Skins.Count]; int skinIndex = 0; for (int i = 0; i < skins.Length; i++) { @@ -61,15 +75,17 @@ public class SkeletonRendererInspector : Editor { } EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Initial Skin"); - EditorGUIUtility.LookLikeControls(); + EditorGUILayout.LabelField("Initial Skin", GUILayout.Width(EditorGUIUtility.labelWidth)); skinIndex = EditorGUILayout.Popup(skinIndex, skins); EditorGUILayout.EndHorizontal(); initialSkinName.stringValue = skins[skinIndex]; } - EditorGUILayout.PropertyField(meshes); + EditorGUILayout.PropertyField(meshes, + new GUIContent("Render Meshes", "Disable to optimize rendering for skeletons that don't use meshes")); + EditorGUILayout.PropertyField(immutableTriangles, + new GUIContent("Immutable Triangles", "Enable to optimize rendering for skeletons that never change attachment visbility")); EditorGUILayout.PropertyField(normals); EditorGUILayout.PropertyField(tangents); } diff --git a/spine-unity/Assets/Spine/SkeletonAnimation.cs b/spine-unity/Assets/Spine/SkeletonAnimation.cs index 63a4be1a5..cb490af27 100644 --- a/spine-unity/Assets/Spine/SkeletonAnimation.cs +++ b/spine-unity/Assets/Spine/SkeletonAnimation.cs @@ -44,8 +44,9 @@ public class SkeletonAnimation : SkeletonRenderer { public delegate void UpdateBonesDelegate(SkeletonAnimation skeleton); public UpdateBonesDelegate UpdateBones; - public String _animationName; - public String animationName { + [SerializeField] + private String _animationName; + public String AnimationName { get { TrackEntry entry = state.GetCurrent(0); return entry == null ? null : entry.Animation.Name; diff --git a/spine-unity/Assets/Spine/SkeletonRenderer.cs b/spine-unity/Assets/Spine/SkeletonRenderer.cs index f6e450762..e632e458c 100644 --- a/spine-unity/Assets/Spine/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/SkeletonRenderer.cs @@ -44,10 +44,9 @@ public class SkeletonRenderer : MonoBehaviour { public SkeletonDataAsset skeletonDataAsset; public String initialSkinName; - public bool calculateNormals; - public bool calculateTangents; + public bool calculateNormals, calculateTangents; public float zSpacing; - public bool renderMeshes; + public bool renderMeshes = true, immutableTriangles; private MeshFilter meshFilter; private Mesh mesh, mesh1, mesh2; @@ -60,8 +59,7 @@ public class SkeletonRenderer : MonoBehaviour { private Material[] sharedMaterials = new Material[0]; private readonly List submeshMaterials = new List(); private readonly List submeshes = new List(); - private readonly int[] quadTriangles = {0, 2, 1, 2, 3, 1}; - + public virtual void Reset () { if (meshFilter != null) meshFilter.sharedMesh = null; if (mesh != null) DestroyImmediate(mesh); @@ -280,8 +278,7 @@ public class SkeletonRenderer : MonoBehaviour { mesh.subMeshCount = submeshCount; for (int i = 0; i < submeshCount; ++i) mesh.SetTriangles(submeshes[i].triangles, i); - mesh.RecalculateBounds(); - + if (newTriangles && calculateNormals) { Vector3[] normals = new Vector3[vertexCount]; Vector3 normal = new Vector3(0, 0, -1); @@ -309,7 +306,11 @@ public class SkeletonRenderer : MonoBehaviour { int submeshIndex = submeshMaterials.Count; submeshMaterials.Add(material); - if (submeshes.Count <= submeshIndex) submeshes.Add(new Submesh()); + if (submeshes.Count <= submeshIndex) + submeshes.Add(new Submesh()); + else if (immutableTriangles) + return; + Submesh submesh = submeshes[submeshIndex]; int[] triangles = submesh.triangles; @@ -346,12 +347,20 @@ public class SkeletonRenderer : MonoBehaviour { List drawOrder = skeleton.DrawOrder; for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) { Attachment attachment = drawOrder[i].attachment; + if (attachment is RegionAttachment) { + triangles[triangleIndex] = firstVertex; + triangles[triangleIndex + 1] = firstVertex + 2; + triangles[triangleIndex + 2] = firstVertex + 1; + triangles[triangleIndex + 3] = firstVertex + 2; + triangles[triangleIndex + 4] = firstVertex + 3; + triangles[triangleIndex + 5] = firstVertex + 1; + triangleIndex += 6; + firstVertex += 4; + continue; + } int[] attachmentTriangles; int attachmentVertexCount; - if (attachment is RegionAttachment) { - attachmentVertexCount = 4; - attachmentTriangles = quadTriangles; - } else if (attachment is MeshAttachment) { + if (attachment is MeshAttachment) { MeshAttachment meshAttachment = (MeshAttachment)attachment; attachmentVertexCount = meshAttachment.vertices.Length >> 1; attachmentTriangles = meshAttachment.triangles; @@ -376,8 +385,8 @@ public class SkeletonRenderer : MonoBehaviour { Vector3 min = new Vector3(float.MaxValue, float.MaxValue, 0f); Vector3 max = new Vector3(float.MinValue, float.MinValue, 0f); foreach (Vector3 vert in vertices) { - min = Vector3.Min (min, vert); - max = Vector3.Max (max, vert); + min = Vector3.Min(min, vert); + max = Vector3.Max(max, vert); } float width = max.x - min.x; float height = max.y - min.y; diff --git a/spine-unity/Assets/examples/dragon/dragon.unity b/spine-unity/Assets/examples/dragon/dragon.unity index 939e489cf3bbfa2269ab0efd5303fb582106ddb0..c2859118f0a62bb10df7962d99973ee907aca14a 100644 GIT binary patch delta 282 zcmbQSfbqrxMgax}4?6~ifCvT#22LP5VWNQjW)8vsjGO(K&NEKFugE&tjYW%5Vsasi z3ZvxYKvv<&dTN4`#SM5T$Fj0dKF1=>C_OoVO_@<ZK!Qc{b2Q;RcFiy0V!b}IoDN=jtr=9ZQuCgr4t z6lEsnrRP8;m4W&t`Aaf$Q-hNeb5a>tfErXlrU^hy%gN6#0GpyZS&2=TQ4Q=Mb+Cgp w;11FRu{NJ#J8jQcuz8x>9LC8DJUBKRd7NUIt<8 delta 240 zcmcbyfN{nGMgax}4>ksd00{;L22LPbVWNQj=49~`jFTT|YD_i|=HKkcbe>Tz)HAQd zf}t!iCo_eC5vUZT90WjY2G7ajET)W-ll9b8Ci@%kPJW{-F*$&nck*HuB}SRa9c;>s zvXj@aDKN@SKFg-aC_h=3RgY0&@;z3`$)&7fjEa-_*(CX@f(sIpGxO3JSbzp9OY@{04NOiE08k^s<-Lq%R*?i7z4&&w`k5ep+ XjFT;WRVSzUYE4e?VA(vu_XHCFoBlne diff --git a/spine-unity/Assets/examples/goblins/goblins.mat b/spine-unity/Assets/examples/goblins/goblins Material.mat similarity index 92% rename from spine-unity/Assets/examples/goblins/goblins.mat rename to spine-unity/Assets/examples/goblins/goblins Material.mat index 0300f813eb2c0489fd0a35802e79257d6763347f..84dfab0dcb934d617d8ae391e70a9c9da422e720 100644 GIT binary patch delta 50 zcmX@0bV7-Pfq^TGfkDt?BZn#%qsL}Fu4k+w0t^fc>G?@HnR&$uzKJENMVW~?n-v5U F7y&ZW4Eg{7 delta 42 xcmX@1bU=xNfq^TGfkDt=BZn#%qr+xBu4k+~>G?@HnR&$wn>7R!7y-*j36cN+ diff --git a/spine-unity/Assets/examples/goblins/goblins.mat.meta b/spine-unity/Assets/examples/goblins/goblins Material.mat.meta similarity index 100% rename from spine-unity/Assets/examples/goblins/goblins.mat.meta rename to spine-unity/Assets/examples/goblins/goblins Material.mat.meta diff --git a/spine-unity/Assets/examples/goblins/goblins.unity b/spine-unity/Assets/examples/goblins/goblins.unity index 7e75e436b15963d063bcc47e26dc645eb4614f31..8eda9d9cb388fb8629f1c7f44a0dd87487c8acdd 100644 GIT binary patch delta 336 zcmeBJ!gyc_qW}Yg_hbf!AO{8p22LP*!$tuMmdzZZ{~0&?F`Z|eoX^I(S(@WKqg<$G zUWo-mW^Qh2Nn%n?YDiILVqSVqYB2*NP^a?b>zwM0Dw7)xg(vUlWaG-o&o2N=s7_Ym z(q&Ye9KfZ_s6M%bOMy{i@>DKGM$OIJxwhHY=K%Ho2ZACXy?J6+^ao}Jh6Es69E!I9 z#R6Cu7*v3KMJV116srJ=1pxU#3XHb_#ZCY@CP4l_sCnCgVhpSd3=TjsM<`BuezwE` zD3%E11KlkLc4IP7a0O6s3Q!Q_AP`OgDV)sZ-M)E}cMcPy$K?OMp3IvsT5tCD<7b>4 a=C3um!JB1rgZ~_s6Z`%i*sKunf)N1n4qE;I delta 290 zcmX@Ggt21@qW}YgcM=0b5C;PT11FH(uu;H*Wpj-53C7I=Y`2&vOLK`ZDo-}xQesq@ z9L%N5s5-fkOPNt^@=`7ZM)k>sTEdfWa`7>0fLNP# hY@4h7_!%en`KwKy5WqfpzyH+9Km7SNCk5PN1OW7_OS%96 diff --git a/spine-unity/Assets/examples/spineboy/spineboy.unity b/spine-unity/Assets/examples/spineboy/spineboy.unity index 71b1709c78f480b96d89d937c0c1929e812ea34f..79364779a9cd910dbc7f82525d6a1fdfd49b3907 100644 GIT binary patch delta 484 zcmY+=KS%;m90%~<)2p~4Pbi3%IPp>=0*Asz+q}-+u>o`10QGbH8`*-D|X1x5eB<`XQ0oB_bK~laAYv*-XcL za9W}1d$y3&iqQ)yb<}g(?VPa!@-`Fsosy+gvX!;T-+(Kh;^8YQwVGURqeSd$Kfc0S- g%p;P7ee&~2&&uekgZFibpBg@U3>#C{g)xwR0p>?^;s5{u delta 457 zcmY+=ze~eF6bJD4ViYo%L@bC~N@LAZ2N4P`#x1oSQmY`PU?-`If@_7Yb*tRs*!~G} zS|@Rn;9uaVThOQl7Z-ngQ%=FaH}~F$$K55-fO`YBiAt+PVULIm)Zw{ZHsqlbu}GFZ zxuzv7i_^C(maGit#Em&G8kWJX*s}_}Ag=Ws=f$J$@S>P0%!f zIl?O6pEi7rsEK+`=uQ3q3pH35=40;n>$YGK%!OrDwqYX?1$Xkal-0zroR<&fSpNYu Cj%+Ld