点击按钮后如何重新启动游戏?我尝试了以下代码:
this.scene.stop();
this.scene.start();
Run Code Online (Sandbox Code Playgroud)
场景重新加载,但预加载功能不再起作用。
试试这个代码:
\n\nthis.registry.destroy(); // destroy registry\nthis.events.off();\xef\xbb\xbf // disable all active events\nthis.scene.restart();\xef\xbb\xbf\xef\xbb\xbf\xef\xbb\xbf\xef\xbb\xbf // restart current scene\nRun Code Online (Sandbox Code Playgroud)\n\n另请参阅Phaser 3 文档以获取更多信息
\n| 归档时间: |
|
| 查看次数: |
7578 次 |
| 最近记录: |