浏览代码

if there is no attachment, remove it also..

Matias 12 年之前
父节点
当前提交
3a0ba4a70a
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      spine-lua/Animation.lua

+ 7 - 7
spine-lua/Animation.lua

@@ -415,14 +415,14 @@ function Animation.AttachmentTimeline.new ()
 		local attachmentName = self.attachmentNames[frameIndex]
     local slot = skeleton.slotsByName[self.slotName]
     if attachmentName then
-        if not slot.attachment then
-            slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName))
-        elseif slot.attachment.name ~= attachmentName then
-            slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName))
-        end
+      if not slot.attachment then
+        slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName))
+      elseif slot.attachment.name ~= attachmentName then
+        slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName))
+      end
+    else
+      slot:setAttachment(nil)
     end
-
-
 	end
 
 	return self