Add methods to clear EmitZone or DeathZone

This commit is contained in:
Rex 2023-04-05 16:36:29 +08:00
parent 8e1306b78d
commit 1e4b807656

View file

@ -1730,6 +1730,21 @@ var ParticleEmitter = new Class({
return this; return this;
}, },
/**
* Clear all Particle Death Zone from this Emitter.
*
* @method Phaser.GameObjects.Particles.ParticleEmitter#clearDeathZone
* @since 3.60.0
*
* @return {this} This Particle Emitter.
*/
clearDeathZone: function ()
{
this.deathZones.length = 0;
return this;
},
/** /**
* Adds a new Particle Emission Zone to this Emitter. * Adds a new Particle Emission Zone to this Emitter.
* *
@ -1820,6 +1835,23 @@ var ParticleEmitter = new Class({
return this; return this;
}, },
/**
* Clear all Particle Emission Zone from this Emitter.
*
* @method Phaser.GameObjects.Particles.ParticleEmitter#clearEmitZone
* @since 3.60.0
*
* @return {this} This Particle Emitter.
*/
clearEmitZone: function ()
{
this.emitZones.length = 0;
this.zoneIndex = 0;
return this;
},
/** /**
* Takes the given particle and sets its x/y coordinates to match the next available * Takes the given particle and sets its x/y coordinates to match the next available
* emission zone, if any have been configured. This method is called automatically * emission zone, if any have been configured. This method is called automatically