lua脚本中,多点找色的函数怎么写?

2025-05-20 05:41:27
推荐回答(1个)
回答1:

function filterColor(src, rgb)
if type(src) ~= "table" or not rgb then
return
end
local ret = {}

for i, v in ipairs(src) do

if v.color == rgb then
ret[#ret+1] = v
end
end

return ret

end