cleanup combat skills

This commit is contained in:
ntr 2018-12-05 20:21:14 +11:00
parent 65bbd82d0e
commit 31883afa43
2 changed files with 6 additions and 2 deletions

View File

@ -61,8 +61,7 @@ class Combat extends Phaser.Scene {
this.registry.set('game', null); this.registry.set('game', null);
this.scene.get('CombatLog').cleanUp(); this.scene.get('CombatLog').cleanUp();
this.scene.get('CombatCryps').cleanUp(); this.scene.get('CombatCryps').cleanUp();
this.scene.get('CombatSkills').cleanUp();
// this.scene.manager.remove('CombatSkills');
this.scene.remove(); this.scene.remove();
return true; return true;
} }

View File

@ -241,6 +241,11 @@ class CombatSkills extends Phaser.Scene {
CRYP_KEY_MAP.forEach(tKey => this.input.keyboard.removeListener(tKey)); CRYP_KEY_MAP.forEach(tKey => this.input.keyboard.removeListener(tKey));
SKILL_KEY_MAP.forEach(tKey => this.input.keyboard.removeListener(tKey)); SKILL_KEY_MAP.forEach(tKey => this.input.keyboard.removeListener(tKey));
} }
cleanUp() {
this.registry.events.off('changedata', this.updateData);
this.scene.remove();
}
} }
module.exports = CombatSkills; module.exports = CombatSkills;