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游戏暂停和恢复
最新推荐文章于 2023-01-06 18:30:18 发布