|
@@ -5,6 +5,11 @@
|
|
* This is mainly define by its coordinates, direction, velocity and age.
|
|
* This is mainly define by its coordinates, direction, velocity and age.
|
|
*/
|
|
*/
|
|
export class Particle {
|
|
export class Particle {
|
|
|
|
+ private static _Count = 0;
|
|
|
|
+ /**
|
|
|
|
+ * Unique ID of the particle
|
|
|
|
+ */
|
|
|
|
+ public id:number;
|
|
/**
|
|
/**
|
|
* The world position of the particle in the scene.
|
|
* The world position of the particle in the scene.
|
|
*/
|
|
*/
|
|
@@ -72,6 +77,9 @@
|
|
public _initialDirection: Nullable<Vector3>;
|
|
public _initialDirection: Nullable<Vector3>;
|
|
|
|
|
|
/** @hidden */
|
|
/** @hidden */
|
|
|
|
+ public _attachedSubEmitters: Nullable<Array<SubEmitter>> = null;
|
|
|
|
+
|
|
|
|
+ /** @hidden */
|
|
public _initialStartSpriteCellID: number;
|
|
public _initialStartSpriteCellID: number;
|
|
public _initialEndSpriteCellID: number;
|
|
public _initialEndSpriteCellID: number;
|
|
|
|
|
|
@@ -127,6 +135,7 @@
|
|
* The particle system the particle belongs to.
|
|
* The particle system the particle belongs to.
|
|
*/
|
|
*/
|
|
public particleSystem: ParticleSystem) {
|
|
public particleSystem: ParticleSystem) {
|
|
|
|
+ this.id = Particle._Count++;
|
|
if (!this.particleSystem.isAnimationSheetEnabled) {
|
|
if (!this.particleSystem.isAnimationSheetEnabled) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -197,6 +206,8 @@
|
|
other.angularSpeed = this.angularSpeed;
|
|
other.angularSpeed = this.angularSpeed;
|
|
other.particleSystem = this.particleSystem;
|
|
other.particleSystem = this.particleSystem;
|
|
other.cellIndex = this.cellIndex;
|
|
other.cellIndex = this.cellIndex;
|
|
|
|
+ other.id = this.id;
|
|
|
|
+ other._attachedSubEmitters = this._attachedSubEmitters;
|
|
if (this._currentColorGradient) {
|
|
if (this._currentColorGradient) {
|
|
other._currentColorGradient = this._currentColorGradient;
|
|
other._currentColorGradient = this._currentColorGradient;
|
|
other._currentColor1.copyFrom(this._currentColor1);
|
|
other._currentColor1.copyFrom(this._currentColor1);
|