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:
commit
473a32b57f
1 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue