diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs index 44567aa..b926db6 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs @@ -455,6 +455,8 @@ public static void addSlotAnimationToClip(AnimationClip foreach(KeyValuePair kvp in slotsAnimation){ string slotName = kvp.Key; string defaultAttachment = spineData.slotDefaultAttachments[slotName]; + if (string.IsNullOrEmpty(defaultAttachment)) + continue; SpineSlotAnimation slotAnimation = kvp.Value; if (slotAnimation.attachment != null && slotAnimation.attachment.Count > 0){ Dictionary curveByName = new Dictionary(); diff --git a/Assets/UnitySpineImporter/SharedScripts/Slot/Slot.cs b/Assets/UnitySpineImporter/SharedScripts/Slot/Slot.cs index ead4bc7..9d8d493 100644 --- a/Assets/UnitySpineImporter/SharedScripts/Slot/Slot.cs +++ b/Assets/UnitySpineImporter/SharedScripts/Slot/Slot.cs @@ -41,6 +41,8 @@ public Slot (string bone, string slot, string attachment = null, Color32? color } public void hideAllAttachments(){ + if (attachments == null) + return; foreach(Attachment a in attachments){ a.gameObject.SetActive(false); }