命名个脚本 eg:cFunction.lua
--List 含有此item
functionIsListHasContains(pList, pItem)if pList ~= nil then
local count = #pList
for i =1, count doif pList[i]== pItem then
returntrue
end
end
end
returnfalse
end
functionHotLuaScriptInEditor(str)local index =0local scripts =string.split(str,";")for file, _ inpairs(package.loaded)dolocal data =string.split(file,".")ifIsListHasContains(scripts, data[#data]) then
package.loaded[file]=nilrequire(file)
index = index +1
end
if index == #scripts then
break
end
endprint("热更了")
end