From 1121cedf60cee4cadcdd43f9702d0c7abfc6e71c Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Tue, 13 Dec 2022 18:51:04 +0000 Subject: [PATCH] Adding in Particle Manager destroy handling --- src/gameobjects/particles/ParticleEmitter.js | 6 ++++++ .../particles/ParticleEmitterManager.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/gameobjects/particles/ParticleEmitter.js b/src/gameobjects/particles/ParticleEmitter.js index fc393c1d3..4b4172f43 100644 --- a/src/gameobjects/particles/ParticleEmitter.js +++ b/src/gameobjects/particles/ParticleEmitter.js @@ -2090,6 +2090,12 @@ var ParticleEmitter = new Class({ depthSortCallback: function (a, b) { return a.y - b.y; + }, + + destroy: function () + { + // TODO + // Particles, animations, etc } }); diff --git a/src/gameobjects/particles/ParticleEmitterManager.js b/src/gameobjects/particles/ParticleEmitterManager.js index 4f4525580..e98183ca1 100644 --- a/src/gameobjects/particles/ParticleEmitterManager.js +++ b/src/gameobjects/particles/ParticleEmitterManager.js @@ -494,6 +494,20 @@ var ParticleEmitterManager = new Class({ */ setBlendMode: function () { + }, + + preDestroy: function () + { + var emitters = this.emitters.list; + + for (var i = 0; i < emitters.length; i++) + { + emitters[i].destroy(); + } + + // TODO + // Wells, references, etc + } });