[CocosCreator]暂停,恢复,退出

退出游戏

cc.director.end();
End the life of director in the next frame

暂停游戏

cc.director.pause();
cc.game.pause();

cc.director.pause():

Pause the director's ticker, only involve the game logic execution.
It won't pause the rendering process nor the event manager.
If you want to pause the entier game including rendering, audio and event,
please use cc.game.pause()

注:cc.director.isPaused()返回值为布尔类型,可用于判断。

恢复游戏

cc.director.resume();
Resume game logic execution after pause, if the current scene is not paused, nothing will happen.

你可能感兴趣的:(CocosCreator)