mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
only update attachments if they change
This commit is contained in:
parent
d270c5e8da
commit
776cc3958d
@ -413,9 +413,16 @@ function Animation.AttachmentTimeline.new ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local attachmentName = self.attachmentNames[frameIndex]
|
local attachmentName = self.attachmentNames[frameIndex]
|
||||||
local attachment
|
local slot = skeleton.slotsByName[self.slotName]
|
||||||
if attachmentName then attachment = skeleton:getAttachment(self.slotName, attachmentName) end
|
if attachmentName then
|
||||||
skeleton.slotsByName[self.slotName]:setAttachment(attachment)
|
if not slot.attachment then
|
||||||
|
slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName))
|
||||||
|
elseif attachmentName and slot.attachment.name ~= attachmentName then
|
||||||
|
slot:setAttachment(skeleton:getAttachment(self.slotName, attachmentName))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user