From 1a6c2b8d9f971a3ff64d50df8e6f4949f3dc227d Mon Sep 17 00:00:00 2001 From: pharan Date: Sun, 30 Apr 2017 21:29:56 +0800 Subject: [PATCH] [unity] Minor editor fixes. --- .../spine-unity/Editor/SkeletonRendererInspector.cs | 6 +++--- .../Assets/spine-unity/Editor/SpineEditorUtilities.cs | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs b/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs index 6021648bc..2950fb2ce 100644 --- a/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs @@ -237,8 +237,8 @@ namespace Spine.Unity.Editor { using (new SpineInspectorUtility.LabelWidthScope()) { // Optimization options - EditorGUILayout.PropertyField(meshes, MeshesLabel); - EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel); + if (meshes != null) EditorGUILayout.PropertyField(meshes, MeshesLabel); + if (immutableTriangles != null) EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel); EditorGUILayout.PropertyField(tintBlack, TintBlackLabel); EditorGUILayout.PropertyField(clearStateOnDisable, ClearStateOnDisableLabel); EditorGUILayout.Space(); @@ -255,7 +255,7 @@ namespace Spine.Unity.Editor { using (new SpineInspectorUtility.LabelWidthScope()) { EditorGUILayout.LabelField("Vertex Data", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(pmaVertexColors, PMAVertexColorsLabel); + if (pmaVertexColors != null) EditorGUILayout.PropertyField(pmaVertexColors, PMAVertexColorsLabel); // Optional fields. May be disabled in SkeletonRenderer. if (normals != null) EditorGUILayout.PropertyField(normals, NormalsLabel); diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs index 1ac0485f7..f81795313 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs @@ -30,7 +30,7 @@ #pragma warning disable 0219 -// Contributed by: Mitch Thompson +// Original contribution by: Mitch Thompson #define SPINE_SKELETONANIMATOR using UnityEngine; @@ -713,7 +713,8 @@ namespace Spine.Unity.Editor { #endregion #region Match SkeletonData with Atlases - static readonly AttachmentType[] NonAtlasTypes = { AttachmentType.Boundingbox, AttachmentType.Path }; + //static readonly AttachmentType[] NonAtlasTypes = { AttachmentType.Boundingbox, AttachmentType.Path }; + static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh }; static List MultiAtlasDialog (List requiredPaths, string initialDirectory, string filename = "") { List atlasAssets = new List(); @@ -850,8 +851,8 @@ namespace Spine.Unity.Editor { Debug.LogWarning(string.Format("Unidentified Attachment type: \"{0}\". Skeleton may have been exported from an incompatible Spine version.", typeString)); throw e; } - - if (NonAtlasTypes.Contains(attachmentType)) + + if (!AtlasTypes.Contains(attachmentType)) continue; } @@ -1304,7 +1305,7 @@ namespace Spine.Unity.Editor { if (!tintBlack) { foreach (Material m in atlasAsset.materials) { - if (m.shader.name.Contains(PMAShaderQuery)) { + if (m.shader.name.Contains(TintBlackShaderQuery)) { tintBlack = true; break; }