求教studio生成的lua工程中怎么递归获得csb文件中的节点

没有回答么 难道没有人用csb文件,否则lua中递归获得节点的函数是必须的吧

如果是指在 lua 中怎么递归(原来内地称 recursion 为递归,学习了……笔记、笔记)取得指定名称的节点的话,大概是如下:

function getChildByNameRecursive(node, name)
local found = node:getChildByName(name)
if found ~= nil then
return found
end
local children = node:getChildren()
for _, child in pairs(children) do
found = getChildByNameRecursive(node, name)
if found ~= nil then
return found
end
end
return nil
end

大致上应该是这样子吧?