如何在Phaser 3上重新加载游戏?

弗拉迪斯拉夫

单击按钮时如何重新启动游戏?我尝试了以下代码:

this.scene.stop();
this.scene.start();

场景重新加载,但是预加载功能不再起作用。

兴奋的

试试这个代码:

this.registry.destroy(); // destroy registry
this.events.off(); // disable all active events
this.scene.restart(); // restart current scene

也可以查看Phaser 3文档以获取更多信息

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章