cocos2d-x游戏暂停和恢复

Feel free to use my recursive methods:

2Pause:

void GamePlayGuiLayer::RevursivelyPauseAllChildren( CCNode * node ) {
node->pauseSchedulerAndActions();

CCObject * obj;
CCARRAY_FOREACH(node -> getChildren(), obj) {
CCNode * n = (CCNode *)obj;
RevursivelyPauseAllChildren(n); 
}
}

2Resume:

void GamePlayGuiLayer::RevursivelyResumeAllChildren( CCNode * node ) {
node->resumeSchedulerAndActions();

CCObject * obj;
CCARRAY_FOREACH(node -> getChildren(), obj) {
CCNode * n = (CCNode *)obj;
RevursivelyResumeAllChildren(n); 
}
}

- See more at: http://www.cocos2d-x.org/boards/6/topics/6887#sthash.xqm2JwU6.dpuf

你可能感兴趣的:(cocos2d-x游戏暂停和恢复)