From c4cc6b5c34282613a9973fe8a8c417d2aef5cb68 Mon Sep 17 00:00:00 2001 From: htl Date: Mon, 5 Jan 2015 14:19:27 +0800 Subject: [PATCH] modify event register function name --- .../lua-bindings/script/framework/components/event.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/lua-bindings/script/framework/components/event.lua b/cocos/scripting/lua-bindings/script/framework/components/event.lua index 1351ca647b..a6ca22b85e 100644 --- a/cocos/scripting/lua-bindings/script/framework/components/event.lua +++ b/cocos/scripting/lua-bindings/script/framework/components/event.lua @@ -29,7 +29,7 @@ function Event:unbind(target) self:init_() end -function Event:onEventListener(eventName, listener, tag) +function Event:on(eventName, listener, tag) assert(type(eventName) == "string" and eventName ~= "", "Event:addEventListener() - invalid eventName") eventName = string.upper(eventName) @@ -50,7 +50,7 @@ function Event:onEventListener(eventName, listener, tag) return self.target_, handle end -Event.addEventListener = Event.onEventListener +Event.addEventListener = Event.on function Event:dispatchEvent(event) event.name = string.upper(tostring(event.name))