You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
608 B
Lua
21 lines
608 B
Lua
-- 支持 function 和 对象内部 handler 不过后者热更会更友好
|
|
return function (method, obj, params)
|
|
return function(...)
|
|
if type(method) == "string" then
|
|
if params then
|
|
return obj[method](obj, params, ...)
|
|
else
|
|
return obj[method](obj, ...)
|
|
end
|
|
else
|
|
if obj and params then
|
|
return method(obj, params, ...)
|
|
elseif obj and not params then
|
|
return method(obj, ...)
|
|
else
|
|
return method(...)
|
|
end
|
|
end
|
|
end
|
|
end
|