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

相关文章:

  • 2021-12-12
  • 2021-12-27
  • 2021-12-12
  • 2021-10-21
  • 2022-12-23
  • 2021-10-24
  • 2021-12-12
  • 2021-12-30
猜你喜欢
  • 2021-07-18
  • 2022-12-23
  • 2021-05-25
  • 2021-12-21
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案