Quantcast
Channel: Cocos中文社区 - 最新帖子
Viewing all articles
Browse latest Browse all 511974

Cocos studio 3.10 导入1.6 工程不能获取控件

$
0
0

谢谢你的解答
网上找了一个递归的方法也可以实现,把我改的llua代码贴一下。

function IWindow:seekNodeByName(root, name)

if ( nil ==root) then
   return nil
end

if (root:getName() == name) then
   return  root
end
local arrayRootChildren = root:getChildren()
for i,v in pairs(arrayRootChildren) do
    if (nil ~= v) then
      local res = self:seekNodeByName(v,name)
      
      if (res ~= nil ) then
            return res
      end
    end
end

end


Viewing all articles
Browse latest Browse all 511974


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>