CocosCreator原生平台退出游戏,暂停和继续

原生平台退出游戏,方法为:
cc.director.end();
官方解释:End the life of director in the next frame
暂停游戏,方法:
cc.director.pause();
官方解释:暂停正在运行的场景,该暂停只会停止游戏逻辑执行,但是不会停止渲染和 UI 响应。 如果想要更彻底得暂停游戏,包含渲染,音频和事件,请使用 Game.pause。
注:cc.director.isPaused()返回值为布尔类型,可用于判断。
cc.director.resume();
恢复暂停场景的游戏逻辑,如果当前场景没有暂停将不发生任何事情。

原文地址:https://www.cnblogs.com/allyh/p/9520884.html