cocos2d CCScene 场景过渡




http://blog.csdn.net/kmyhy/article/details/6387141

两个场景过渡时,这些函数的执行顺序=。=
A to B

A.init  A.onEnter  A.onEnterTransition
B.init  A.onExit    A.dealloc  
B.onEnter   B.onEnterTransition

使用了 CCTransitionScene 的顺序会不一样- -
A.init  A.onEnter  A.onEnterTransition
B.init  B.onEnter  A.onExit   
B.onEnterTransition   A.dealloc  

注意A.dealloc


/** callback that is called every time the CCNode enters the 'stage'.
 If the CCNode enters the 'stage' with a transition, this callback is called when the transition starts.
 During onEnter you can't a "sister/brother" node.
 */
-(void) onEnter;
/** callback that is called when the CCNode enters in the 'stage'.
 If the CCNode enters the 'stage' with a transition, this callback is called when the transition finishes.
 @since v0.8
 */
-(void) onEnterTransitionDidFinish;
/** callback that is called every time the CCNode leaves the 'stage'.
 If the CCNode leaves the 'stage' with a transition, this callback is called when the transition finishes.
 During onExit you can't a "sister/brother" node.
 */
-(void) onExit;

你可能感兴趣的:(cocos2d)