fix: fading
This commit is contained in:
parent
6584578316
commit
cc80cbad06
|
|
@ -81,6 +81,7 @@ export function PhaserGame(props: PhaserGameProps) {
|
||||||
const fade = phaserGame.scene.getScene(FADE_SCENE_KEY) as FadeSceneClass;
|
const fade = phaserGame.scene.getScene(FADE_SCENE_KEY) as FadeSceneClass;
|
||||||
|
|
||||||
// 淡出到黑色
|
// 淡出到黑色
|
||||||
|
phaserGame.scene.bringToTop(FADE_SCENE_KEY);
|
||||||
await fade.fadeOut(300);
|
await fade.fadeOut(300);
|
||||||
|
|
||||||
// 停止当前场景
|
// 停止当前场景
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,8 @@ export class GameScene extends GameHostScene<TicTacToeState> {
|
||||||
const currentPlayer = this.state.currentPlayer;
|
const currentPlayer = this.state.currentPlayer;
|
||||||
this.updateTurnText(currentPlayer);
|
this.updateTurnText(currentPlayer);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.gameHost.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 创建棋盘视觉元素(网格、标题、回合提示) */
|
/** 创建棋盘视觉元素(网格、标题、回合提示) */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue