forked from XINCGer/Unity3DTraining
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventMgr.lua
More file actions
49 lines (35 loc) · 809 Bytes
/
Copy pathEventMgr.lua
File metadata and controls
49 lines (35 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require("Class")
local bit = require "bit"
EventMgr = {
--实例对象
_instance = nil
}
EventMgr.__index = EventMgr
setmetatable(EventMgr,Class)
-- 构造器
function EventMgr:new()
local t = {}
t = Class:new()
setmetatable(t,EventMgr)
return t
end
-- 获取单例接口
function EventMgr:Instance()
if EventMgr._instance == nil then
EventMgr._instance = EventMgr:new()
end
return EventMgr._instance
end
function EventMgr:RegisterEvent(moduleId,eventId,func)
end
function EventMgr:UnRegisterEvent(moduleId,eventId,func)
end
function EventMgr:DispatchEvent(moduleId, eventId, param)
end
function EventMgr:AddEventListener(eventId, func, param)
end
function EventMgr:RemoveEventListener(eventId, func)
end
function EventMgr:Test()
print("Test")
end