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






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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值