mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fixed images not being removed correctly.
This commit is contained in:
parent
a9315d46f3
commit
9f6fd34389
@ -90,19 +90,18 @@ function spine.Skeleton.new (skeletonData, group)
|
|||||||
local updateWorldTransform_super = self.updateWorldTransform
|
local updateWorldTransform_super = self.updateWorldTransform
|
||||||
function self:updateWorldTransform ()
|
function self:updateWorldTransform ()
|
||||||
updateWorldTransform_super(self)
|
updateWorldTransform_super(self)
|
||||||
local images = self.images
|
|
||||||
|
|
||||||
|
local images = self.images
|
||||||
local skeletonR, skeletonG, skeletonB, skeletonA = self.r * 255, self.g * 255, self.b * 255, self.a
|
local skeletonR, skeletonG, skeletonB, skeletonA = self.r * 255, self.g * 255, self.b * 255, self.a
|
||||||
for i,slot in ipairs(self.drawOrder) do
|
for i,slot in ipairs(self.drawOrder) do
|
||||||
local attachment = slot.attachment
|
|
||||||
if attachment and attachment.type == spine.AttachmentType.region then
|
|
||||||
local image = images[slot]
|
local image = images[slot]
|
||||||
|
local attachment = slot.attachment
|
||||||
if not attachment then -- Attachment is gone, remove the image.
|
if not attachment then -- Attachment is gone, remove the image.
|
||||||
if image then
|
if image then
|
||||||
image:removeSelf()
|
image:removeSelf()
|
||||||
images[slot] = nil
|
images[slot] = nil
|
||||||
end
|
end
|
||||||
else
|
elseif attachment.type == spine.AttachmentType.region then
|
||||||
if image and image.attachment ~= attachment then -- Attachment image has changed.
|
if image and image.attachment ~= attachment then -- Attachment image has changed.
|
||||||
if self:modifyImage(image, attachment) then
|
if self:modifyImage(image, attachment) then
|
||||||
image.lastR, image.lastA = nil, nil
|
image.lastR, image.lastA = nil, nil
|
||||||
@ -190,7 +189,6 @@ function spine.Skeleton.new (skeletonData, group)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if self.debug then
|
if self.debug then
|
||||||
for i,bone in ipairs(self.bones) do
|
for i,bone in ipairs(self.bones) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user