FIX: trying to start a emote after a scene is desotryed should not crash the game
This commit is contained in:
@@ -261,7 +261,7 @@ export abstract class Character extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createStartTransition(scalingFactor: number, emoteY: number) {
|
private createStartTransition(scalingFactor: number, emoteY: number) {
|
||||||
this.emoteTween = this.scene.tweens.add({
|
this.emoteTween = this.scene?.tweens.add({
|
||||||
targets: this.emote,
|
targets: this.emote,
|
||||||
props: {
|
props: {
|
||||||
scale: scalingFactor,
|
scale: scalingFactor,
|
||||||
@@ -277,7 +277,7 @@ export abstract class Character extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private startPulseTransition(emoteY: number, scalingFactor: number) {
|
private startPulseTransition(emoteY: number, scalingFactor: number) {
|
||||||
this.emoteTween = this.scene.tweens.add({
|
this.emoteTween = this.scene?.tweens.add({
|
||||||
targets: this.emote,
|
targets: this.emote,
|
||||||
props: {
|
props: {
|
||||||
y: emoteY * 1.3,
|
y: emoteY * 1.3,
|
||||||
@@ -294,7 +294,7 @@ export abstract class Character extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private startExitTransition(emoteY: number) {
|
private startExitTransition(emoteY: number) {
|
||||||
this.emoteTween = this.scene.tweens.add({
|
this.emoteTween = this.scene?.tweens.add({
|
||||||
targets: this.emote,
|
targets: this.emote,
|
||||||
props: {
|
props: {
|
||||||
alpha: 0,
|
alpha: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user