mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 22:52:14 +00:00
Add ParticleEmitter.remove() and ParticleEmitterManager#removeEmitter()
This commit is contained in:
parent
64690cf987
commit
15506e0faf
2 changed files with 30 additions and 0 deletions
|
@ -1782,6 +1782,21 @@ var ParticleEmitter = new Class({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the emitter from its manager and the scene.
|
||||||
|
*
|
||||||
|
* @method Phaser.GameObjects.Particles.ParticleEmitter#remove
|
||||||
|
* @since 3.22.0
|
||||||
|
*
|
||||||
|
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||||
|
*/
|
||||||
|
remove: function ()
|
||||||
|
{
|
||||||
|
this.manager.removeEmitter(this);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorts active particles with {@link Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback}.
|
* Sorts active particles with {@link Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback}.
|
||||||
*
|
*
|
||||||
|
|
|
@ -277,6 +277,21 @@ var ParticleEmitterManager = new Class({
|
||||||
return this.addEmitter(new ParticleEmitter(this, config));
|
return this.addEmitter(new ParticleEmitter(this, config));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a Particle Emitter from this Emitter Manager, if the Emitter belongs to this Manager.
|
||||||
|
*
|
||||||
|
* @method Phaser.GameObjects.Particles.ParticleEmitterManager#removeEmitter
|
||||||
|
* @since 3.22.0
|
||||||
|
*
|
||||||
|
* @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter
|
||||||
|
*
|
||||||
|
* @return {?Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter if it was removed or null if it was not.
|
||||||
|
*/
|
||||||
|
removeEmitter: function (emitter)
|
||||||
|
{
|
||||||
|
return this.emitters.remove(emitter, true);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an existing Gravity Well object to this Emitter Manager.
|
* Adds an existing Gravity Well object to this Emitter Manager.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue