From f7dae4f370c8e61afae6c472614247ca74df987d Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 25 Apr 2019 03:43:31 -0500 Subject: [PATCH] Emitter::[destroy|particleCount] --- common/combat/emitter.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/combat/emitter.js b/common/combat/emitter.js index 04feb08..6e0b96f 100644 --- a/common/combat/emitter.js +++ b/common/combat/emitter.js @@ -55,6 +55,10 @@ export class DamageEmitter { this.proton.addRender(this.renderer); } + destroy() { + this.proton.destroy(); + } + emit(position, damage) { // BUGS const pz = new Proton.PointZone(); @@ -84,7 +88,11 @@ export class DamageEmitter { } hasParticles() { - return this.emitter.particles.length > 0; + return this.particleCount > 0; + } + + get particleCount() { + return this.emitter.particles.length; } tick(elapsed) {