mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Added findBone.
This commit is contained in:
parent
cdadffc156
commit
567c7110b1
@ -65,6 +65,14 @@ function Skeleton.new (skeletonData)
|
|||||||
return self.bones[1]
|
return self.bones[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function self:findBone (boneName)
|
||||||
|
if not boneName then error("boneName cannot be nil.", 2) end
|
||||||
|
for i,bone in ipairs(self.bones) do
|
||||||
|
if bone.data.name == boneName then return bone end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
function self:findSlot (slotName)
|
function self:findSlot (slotName)
|
||||||
if not slotName then error("slotName cannot be nil.", 2) end
|
if not slotName then error("slotName cannot be nil.", 2) end
|
||||||
for i,slot in ipairs(self.slots) do
|
for i,slot in ipairs(self.slots) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user