fixed linting
This commit is contained in:
parent
8c35860f2a
commit
6c512fb7cd
@ -16,6 +16,7 @@ export class Companion extends Container {
|
|||||||
|
|
||||||
private delta: number;
|
private delta: number;
|
||||||
private invisible: boolean;
|
private invisible: boolean;
|
||||||
|
private updateListener: Function;
|
||||||
private target: { x: number, y: number, direction: PlayerAnimationDirections };
|
private target: { x: number, y: number, direction: PlayerAnimationDirections };
|
||||||
|
|
||||||
private companionName: string;
|
private companionName: string;
|
||||||
@ -53,7 +54,8 @@ export class Companion extends Container {
|
|||||||
|
|
||||||
this.setDepth(-1);
|
this.setDepth(-1);
|
||||||
|
|
||||||
this.scene.events.addListener('update', this.step, this);
|
this.updateListener = this.step.bind(this);
|
||||||
|
this.scene.events.addListener('update', this.updateListener);
|
||||||
|
|
||||||
this.scene.add.existing(this);
|
this.scene.add.existing(this);
|
||||||
}
|
}
|
||||||
@ -213,7 +215,7 @@ export class Companion extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.scene) {
|
if (this.scene) {
|
||||||
this.scene.events.removeListener('update', this.step, this);
|
this.scene.events.removeListener('update', this.updateListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.destroy();
|
super.destroy();
|
||||||
|
Loading…
Reference in New Issue
Block a user