切换场景特效和CCNode某些函数调用顺序的关系

scene1为初始启动scene,接着切换到scene2.
是否使用CCTransitionScene的子类场景切换特效,影响到某些CCNode函数调用顺序,红字部分:
1)不使用场景切换:
程序启动:
cocos2d-x debug info [scene 1 ----init()]
cocos2d-x debug info [scene 1 ----onEnter()]
cocos2d-x debug info [scene 1 ----onEnterTransitionDidFinish()]
切换:
cocos2d-x debug info [scene 2 ----init()]
cocos2d-x debug info [scene 1 ----onExitTransitionDidStart()]
cocos2d-x debug info [scene 1 ----onExit()]
cocos2d-x debug info [scene 2 ----onEnter()]
cocos2d-x debug info [scene 2 ----onEnterTransitionDidFinish()]
2)使用场景切换:
程序启动:
cocos2d-x debug info [scene 1 ----init()]
cocos2d-x debug info [scene 1 ----onEnter()]
cocos2d-x debug info [scene 1 ----onEnterTransitionDidFinish()]
切换:
cocos2d-x debug info [scene 2 ----init()]
cocos2d-x debug info [scene 1 ----onExitTransitionDidStart()]
cocos2d-x debug info [scene 2 ----onEnter()]
cocos2d-x debug info [scene 1 ----onExit()]

cocos2d-x debug info [scene 2 ----onEnterTransitionDidFinish()]


若涉及逻辑处理,请注意调用顺序。


阅读更多
文章标签: cocos2d-x
个人分类: cocos2d-x
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭