Added emit zone total property

This commit is contained in:
Richard Davey 2023-01-02 16:51:56 +00:00
parent f8202853e2
commit f848b1dbe6
3 changed files with 28 additions and 1 deletions

View file

@ -8,4 +8,5 @@
* @property {number} [stepRate] - The distance between each particle. When set, `quantity` is implied and should be set to 0.
* @property {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start.
* @property {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other.
* @property {number} [total=1] - The total number of particles this zone will emit before passing over to the next emission zone in the Emitter.
*/

View file

@ -20,15 +20,17 @@ var Class = require('../../../utils/Class');
* @param {number} stepRate - The distance between each particle. When set, `quantity` is implied and should be set to 0.
* @param {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start.
* @param {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other.
* @param {number} [total=1] - The total number of particles this zone will emit before passing over to the next emission zone in the Emitter.
*/
var EdgeZone = new Class({
initialize:
function EdgeZone (source, quantity, stepRate, yoyo, seamless)
function EdgeZone (source, quantity, stepRate, yoyo, seamless, total)
{
if (yoyo === undefined) { yoyo = false; }
if (seamless === undefined) { seamless = true; }
if (total === undefined) { total = 1; }
/**
* An object instance with a `getPoints(quantity, stepRate)` method returning an array of points.
@ -119,6 +121,18 @@ var EdgeZone = new Class({
*/
this._direction = 0;
/**
* The total number of particles this zone will emit before the Emitter
* transfers control over to the next zone in its emission zone list.
* By default this is 1, meaning the zones rotate in order, but it can
* be set to any positive value.
*
* @name Phaser.GameObjects.Particles.Zones.EdgeZone#total
* @type {number}
* @since 3.60.0
*/
this.total = total;
this.updateSource();
},

View file

@ -42,6 +42,18 @@ var RandomZone = new Class({
* @since 3.0.0
*/
this._tempVec = new Vector2();
/**
* The total number of particles this zone will emit before the Emitter
* transfers control over to the next zone in its emission zone list.
* By default this is 1, meaning the zones rotate in order, but it can
* be set to any positive value.
*
* @name Phaser.GameObjects.Particles.Zones.RandomZone#total
* @type {number}
* @since 3.60.0
*/
this.total = 1;
},
/**