单击按钮时如何重新启动游戏?我尝试了以下代码:
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] 删除。
我来说两句