Merge pull request #1134 from thecodingmachine/fixEmoteScene

FIX: trying to start a emote after a scene is desotryed should not crash the game
This commit is contained in:
Kharhamel 2021-06-07 17:51:35 +02:00 committed by GitHub
commit 473a32b57f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,7 +261,7 @@ export abstract class Character extends Container {
}
private createStartTransition(scalingFactor: number, emoteY: number) {
this.emoteTween = this.scene.tweens.add({
this.emoteTween = this.scene?.tweens.add({
targets: this.emote,
props: {
scale: scalingFactor,
@ -277,7 +277,7 @@ export abstract class Character extends Container {
}
private startPulseTransition(emoteY: number, scalingFactor: number) {
this.emoteTween = this.scene.tweens.add({
this.emoteTween = this.scene?.tweens.add({
targets: this.emote,
props: {
y: emoteY * 1.3,
@ -294,7 +294,7 @@ export abstract class Character extends Container {
}
private startExitTransition(emoteY: number) {
this.emoteTween = this.scene.tweens.add({
this.emoteTween = this.scene?.tweens.add({
targets: this.emote,
props: {
alpha: 0,