直接贴代码
local danli = nil
local classname = class("classname")
function classname:getInstance()
if danli == nil then
danli = classname.new()
end
return danli
end
return classname
使用
local duixiagn = classname:getInstance()
时间: 2024-10-09 14:12:49