28 lines
540 B
Lua
28 lines
540 B
Lua
--- 注册表:注册东西,然后可以在任意时刻执行或者获取这样子
|
|
RegTool = {};
|
|
|
|
RegTool.Enums = {
|
|
CheckBigWorldSubLevelLoad = 1,
|
|
}
|
|
|
|
RegTool.Regs = {};
|
|
|
|
function RegTool:Register(InKey, InFunc, InOwner)
|
|
self.Regs[InKey] = {
|
|
Func = InFunc,
|
|
Owner = InOwner,
|
|
}
|
|
end
|
|
|
|
function RegTool:UnRegister(InKey, InFunc)
|
|
self.Regs[InKey] = nil;
|
|
end
|
|
|
|
function RegTool:Do(InKey, ...)
|
|
if self.Regs[InKey] then
|
|
return table.func(self.Regs[InKey].Owner, self.Regs[InKey].Func, ...);
|
|
end
|
|
return nil;
|
|
end
|
|
|
|
return RegTool; |