fix(framework): access scene key via sys.settings in PhaserScene
Use `scene.sys.settings.key` instead of `scene.scene.key` to correctly retrieve the scene key from the Phaser scene instance.
This commit is contained in:
parent
85bc4f5400
commit
22817945cc
|
|
@ -215,7 +215,7 @@ export function PhaserScene<TData = {}>(props: PhaserSceneProps<TData>) {
|
|||
|
||||
// 注册场景到 Phaser(但不启动)
|
||||
const scene = "scene" in props.scene ? props.scene : new props.scene();
|
||||
const sceneKey = props.sceneKey ?? scene.scene.key;
|
||||
const sceneKey = props.sceneKey ?? scene.sys.settings.key;
|
||||
if (!game.scene.getScene(sceneKey)) {
|
||||
const initData = {
|
||||
...props.data,
|
||||
|
|
|
|||
Loading…
Reference in New Issue