Unregister spine event lua event handler should set listener to null. (#12845)

This commit is contained in:
Jason Xu 2017-11-21 10:55:55 +08:00 committed by minggo
parent bcfdb57a66
commit a8b6e33d9c
1 changed files with 4 additions and 0 deletions

View File

@ -320,21 +320,25 @@ int tolua_Cocos2d_CCSkeletonAnimation_unregisterSpineEventHandler00(lua_State* t
switch (eventType) { switch (eventType) {
case spEventType::SP_ANIMATION_START: case spEventType::SP_ANIMATION_START:
handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_START; handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_START;
self->setStartListener(nullptr);
break; break;
case spEventType::SP_ANIMATION_INTERRUPT: case spEventType::SP_ANIMATION_INTERRUPT:
handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_INTERRUPT; handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_INTERRUPT;
break; break;
case spEventType::SP_ANIMATION_END: case spEventType::SP_ANIMATION_END:
handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_END; handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_END;
self->setEndListener(nullptr);
break; break;
case spEventType::SP_ANIMATION_DISPOSE: case spEventType::SP_ANIMATION_DISPOSE:
handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_DISPOSE; handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_DISPOSE;
break; break;
case spEventType::SP_ANIMATION_COMPLETE: case spEventType::SP_ANIMATION_COMPLETE:
handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_COMPLETE; handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_COMPLETE;
self->setCompleteListener(nullptr);
break; break;
case spEventType::SP_ANIMATION_EVENT: case spEventType::SP_ANIMATION_EVENT:
handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_EVENT; handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_EVENT;
self->setEventListener(nullptr);
break; break;
default: default: