• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

lua解析树形字符串拼接问题

原作者: [db:作者] 来自: [db:来源] 收藏 邀请






local components_url_tree =

{
main_wid = 
{
left_part = 
{
purple_flag = 
{
purple_flag_title = {},
},
talisman_name_bg = 
{
talisman_name = {},
},
talisman_sv_container = 
{
cell_tmp = {},
},
model_container = {},
process_bar_bg = 
{
process_title = {},
process_bar = 
{
process_value = {},
},
},
talisman_active_btn = 
{
talisman_active_btn_title = {},
},
auto_boost_check = 
{
auto_boost_mask = {},
},
autuo_boost_msg = {},
unactive_notice_msg = 
{
unactive_note1 = {},
unactive_note2 = {},
unactive_note3 = {},
unactive_note4 = {},
},
fight_value_bar = {},
},
right_part = 
{
talisman_btn_container = 
{
nomal_talisman_btn = {},
nomal_talisman_btn_title = {},
huodong_talisman_btn = {},
huodong_talisman_btn_title = {},
},
talisman_profit_info_container = 
{
profit_title_container = 
{
profit_title_bg = 
{
profit_title = {},
},
},
attr_info_container = 
{
property_title1 = {},
property_title2 = {},
property_title3 = {},
property_title4 = {},
total_property_val1 = {},
total_property_val2 = {},
total_property_val3 = {},
total_property_val4 = {},
boost_property_val1 = {},
boost_property_val2 = {},
boost_property_val3 = {},
boost_property_val4 = {},
},
talisman_skill_container = 
{
talisman_skill_title_bg = 
{
talisman_skill_title = {},
},
},
talisman_skill_img_container = 
{
talisman_skill_img = {},
},
talisman_boost_meta_title_container = 
{
meta_title_bg = 
{
meta_title = {},
},
},
talisman_meta_info_container = 
{
item_container1 = {},
item_container2 = {},
item_container3 = {},
talisman_boost_up_btn = 
{
talisman_boost_up_btn_title = {},
},
talisman_boost_once_btn = 
{
talisman_boost_once_btn_title = {},
},
},


},

},
},
}


local components_needs_type_tree = 
{
purple_flag_title = TUILabel,
talisman_name = TUILabel,
question_btn = TUIButton,
huodong_spirit_sv_container = TUIWidget,
cell_tmp = TUIWidget,
model_container = TUIWidget,
process_bar_bg = TUISprite,
process_title = TUILabel,
process_bar = TUISprite,
process_value = TUILabel,
talisman_active_btn = TUIButton,
talisman_active_btn_title = TUILabel,
auto_boost_check = TUIButton,
auto_boost_mask = TUISprite,
autuo_boost_msg = TUILabel,
unactive_notice_msg = TUIWidget,
unactive_note1 = TUILabel,
unactive_note2 = TUILabel,
unactive_note3 = TUILabel,
unactive_note4 = TUILabel,
fight_value_bar = TUISprite,
nomal_talisman_btn = TUIButton,
nomal_talisman_btn_title = TUILabel,
huodong_talisman_btn = TUIButton,
huodong_talisman_btn_title = TUILabel,
profit_title = TUILabel,
property_title1 = TUILabel,
property_title2 = TUILabel,
property_title3 = TUILabel,
property_title4 = TUILabel,
total_property_val1 = TUILabel,
total_property_val2 = TUILabel,
total_property_val3 = TUILabel,
total_property_val4 = TUILabel,
boost_property_val1 = TUILabel,
boost_property_val2 = TUILabel,
boost_property_val3 = TUILabel,
boost_property_val4 = TUILabel,
talisman_skill_title = TUILabel,
talisman_skill_img = TUIWidget,
meta_title = TUILabel,
item_container1 = TUIWidget,
item_container2 = TUIWidget,
item_container3 = TUIWidget,
talisman_boost_up_btn = TUIButton,
talisman_boost_up_btn_title = TUILabel,
talisman_boost_once_btn = TUIButton,
talisman_boost_once_btn_title = TUILabel,
}


local url_tab = {}


function SearchingTree(ComponentsUrlTree)
for k, v in pairs(ComponentsUrlTree) do
url_tab[#url_tab + 1] = k
local url_str = table.concat(url_tab, "/")
print(url_str)
if components_needs_type_tree[k] ~= nil then
local url_str = table.concat(url_tab, "/")
local com_type = components_needs_type_tree[k]
-- self[k] = self:FindChild(url_str):GetComponent(com_type)
end
SearchingTree(v)
url_tab[#url_tab] = nil
end
end




SearchingTree(components_url_tree)














































鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Lua学习(5)——迭代器与泛型for发布时间:2022-07-22
下一篇:
PHP、Lua中的 尾调用发布时间:2022-07-22
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap