mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
change name of nameIndices to slotNameIndices to reflect the contents better
This commit is contained in:
parent
c5016f0da0
commit
d270c5e8da
@ -99,7 +99,7 @@ function Skeleton.new (skeletonData)
|
||||
function self:getAttachment (slotName, attachmentName)
|
||||
if not slotName then error("slotName cannot be nil.", 2) end
|
||||
if not attachmentName then error("attachmentName cannot be nil.", 2) end
|
||||
local slotIndex = skeletonData.nameIndices[slotName]
|
||||
local slotIndex = skeletonData.slotNameIndices[slotName]
|
||||
if slotIndex == -1 then error("Slot not found: " .. slotName, 2) end
|
||||
if self.skin then
|
||||
local attachment = self.skin:getAttachment(slotIndex, attachmentName)
|
||||
|
||||
@ -28,7 +28,7 @@ function SkeletonData.new ()
|
||||
local self = {
|
||||
bones = {},
|
||||
slots = {},
|
||||
nameIndices = {},
|
||||
slotNameIndices = {},
|
||||
skins = {},
|
||||
animations = {}
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ function SkeletonJson.new (attachmentLoader)
|
||||
|
||||
slotData.attachmentName = slotMap["attachment"]
|
||||
table.insert(skeletonData.slots, slotData)
|
||||
skeletonData.nameIndices[slotData.name] = #skeletonData.slots
|
||||
skeletonData.slotNameIndices[slotData.name] = #skeletonData.slots
|
||||
end
|
||||
end
|
||||
|
||||
@ -113,7 +113,7 @@ function SkeletonJson.new (attachmentLoader)
|
||||
for skinName,skinMap in pairs(map) do
|
||||
local skin = Skin.new(skinName)
|
||||
for slotName,slotMap in pairs(skinMap) do
|
||||
local slotIndex = skeletonData.nameIndices[slotName]
|
||||
local slotIndex = skeletonData.slotNameIndices[slotName]
|
||||
for attachmentName,attachmentMap in pairs(slotMap) do
|
||||
local attachment = readAttachment(attachmentName, attachmentMap, self.scale)
|
||||
if attachment then
|
||||
@ -213,7 +213,7 @@ function SkeletonJson.new (attachmentLoader)
|
||||
local slotsMap = map["slots"]
|
||||
if slotsMap then
|
||||
for slotName,timelineMap in pairs(slotsMap) do
|
||||
local slotIndex = skeletonData.nameIndices[slotName]
|
||||
local slotIndex = skeletonData.slotNameIndices[slotName]
|
||||
|
||||
for timelineName,values in pairs(timelineMap) do
|
||||
if timelineName == TIMELINE_COLOR then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user