您的位置:首页 > 移动开发 > Cocos引擎

COCOS-GETchildbyname

2016-06-27 18:40 459 查看
    local child = _node:getChildByName(_name)

    -- print("find" .. _name .. "in" .. _node:getName())

    if child then

        return child 

    else

        local children = _node:getChildren()

        for i=1, #children do

            child = ToolKit:getOnlyChildByName(children[i], _name)

            if child then

                return child

            end

        end

        return nil

    end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: