cocos2d-x + lua中无发获取事件onEnterTransitionDidFinish

--[[
    南阳草庐软件科技有限公司
    hi.baidu.com/xingyan126
    [email protected]
]]

UISceneMain = CCScene:create()

UISceneMain.size = CCDirector:sharedDirector():getWinSize()
--初始化场景--------------------------
function UISceneMain:init()
    self.scene  = self
    self.scene:addChild(CCLayerColor:create(ccc4(50, 185, 179, 255), self.size.width, self.size.height))
    CCDirector:sharedDirector():runWithScene(self.scene)
    self:registerScriptHandler(sceneEventHandler) 
end
--重载onEnter()事件------------------
function UISceneMain:onEnter()
    print('=====进入场景=====')
end
--监听进入动画完成动作
function UISceneMain:onEnterTransitionDidFinish()
    print('===========进入动画完成======')
end 

    
function sceneEventHandler(eventType)  
    if eventType == kCCNodeOnEnter then  
        UISceneMain:onEnter()  
    else  
        print('==========事件类型:'..eventType)
    end  
end

--运行代码--------------------------- 
UISceneMain:init()

上述代码只能获取到scene的onEnter()事件
缺无法获取到onEnterTransitionDidFinish()动画完成事件
不知道cocos2d-x中如何自行注册此类事件呢?
留下次博客谁能解决评论中给说下哈


你可能感兴趣的:(function,lua)