|
@@ -100648,10 +100648,20 @@ var BABYLON;
|
|
|
ParticleHelper.CreateSystem = function (data, scene, emitter) {
|
|
|
// Create a particle system
|
|
|
var system = new BABYLON.ParticleSystem(data.type, data.capacity, scene);
|
|
|
+ // Where the particles come from
|
|
|
+ system.emitter = emitter; // the starting object, the emitter
|
|
|
+ ParticleHelper.UpdateSystem(system, data, scene);
|
|
|
+ return system;
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Static function used to update a particle system from a IParticleSystemData
|
|
|
+ * @param system defines the particle system to update
|
|
|
+ * @param data defines the source data
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ */
|
|
|
+ ParticleHelper.UpdateSystem = function (system, data, scene) {
|
|
|
// Texture of each particle
|
|
|
system.particleTexture = new BABYLON.Texture(ParticleHelper._baseAssetsUrl + "/textures/" + data.textureFile, scene);
|
|
|
- // Where the particles come from
|
|
|
- system.emitter = emitter; // the starting object, the emitter
|
|
|
// Colors of all particles
|
|
|
system.color1 = new BABYLON.Color4(data.color1.r, data.color1.g, data.color1.b, data.color1.a);
|
|
|
system.color2 = new BABYLON.Color4(data.color2.r, data.color2.g, data.color2.b, data.color2.a);
|
|
@@ -100700,7 +100710,6 @@ var BABYLON;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- return system;
|
|
|
};
|
|
|
/**
|
|
|
* Base Assets URL.
|