Explorar el Código

if there is no attachment, remove it also..

Matias hace 12 años
padre
commit
3a0ba4a70a
Se han modificado 1 ficheros con 7 adiciones y 7 borrados
  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