瀏覽代碼

[lua] Ported active bone check in SkeletonBounds. See #1378.

badlogic 6 年之前
父節點
當前提交
d618a639aa
共有 1 個文件被更改,包括 12 次插入10 次删除
  1. 12 10
      spine-lua/SkeletonBounds.lua

+ 12 - 10
spine-lua/SkeletonBounds.lua

@@ -59,16 +59,18 @@ function SkeletonBounds:update (skeleton, updateAabb)
 	local slots = skeleton.slots
 
 	for _,slot in ipairs(skeleton.slots) do
-		local attachment = slot.attachment
-		if attachment and attachment.type == AttachmentType.boundingbox then
-			local boundingBox = attachment
-			table_insert(boundingBoxes, boundingBox)
-
-			local polygon = {}
-			table_insert(polygons, polygon)
-
-			boundingBox:computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2)
-		end
+    if (slot.bone.active) then
+      local attachment = slot.attachment
+      if attachment and attachment.type == AttachmentType.boundingbox then
+        local boundingBox = attachment
+        table_insert(boundingBoxes, boundingBox)
+
+        local polygon = {}
+        table_insert(polygons, polygon)
+
+        boundingBox:computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2)
+      end
+    end
 	end
 
 	if updateAabb then