Added findBone.

This commit is contained in:
NathanSweet 2013-05-09 18:23:23 +02:00
parent cdadffc156
commit 567c7110b1

View File

@ -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