Hatch Cleanup

pull/41/head
Matthew 2024-04-05 14:04:01 -04:00 committed by Samuel H
parent 1167b21d7e
commit 0c579de6b1
1 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import PokemonInfoContainer from "./ui/pokemon-info-container";
export class EggHatchPhase extends Phase {
private egg: Egg;
private eggHatchHandler: EggHatchSceneHandler;
private eggHatchContainer: Phaser.GameObjects.Container;
private eggHatchBg: Phaser.GameObjects.Image;
private eggHatchOverlay: Phaser.GameObjects.Rectangle;
@ -58,9 +59,9 @@ export class EggHatchPhase extends Phase {
this.scene.fadeOutBgm(null, false);
const eggHatchHandler = this.scene.ui.getHandler() as EggHatchSceneHandler;
this.eggHatchHandler = this.scene.ui.getHandler() as EggHatchSceneHandler;
this.eggHatchContainer = eggHatchHandler.eggHatchContainer;
this.eggHatchContainer = this.eggHatchHandler.eggHatchContainer;
this.eggHatchBg = this.scene.add.image(0, 0, 'default_bg');
this.eggHatchBg.setOrigin(0, 0);
@ -152,6 +153,10 @@ export class EggHatchPhase extends Phase {
});
});
}
end() {
this.eggHatchHandler.clear()
super.end()
}
doEggShake(intensity: number, repeatCount?: integer, count?: integer): Promise<void> {
return new Promise(resolve => {