Browse Source

Add startDlay to parse

David Catuhe 7 năm trước cách đây
mục cha
commit
05aaca022b

+ 4 - 0
src/Particles/babylon.IParticleSystem.ts

@@ -143,6 +143,10 @@ module BABYLON {
          * It can be for example box, sphere, or cone...
          */
         particleEmitterType: Nullable<IParticleEmitterType>;  
+        /**
+         * Defines the delay in milliseconds before starting the system (0 by default)
+         */
+        startDelay: number;        
         /** 
          * Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 
          */

+ 2 - 0
src/Particles/babylon.particleSystem.ts

@@ -1944,6 +1944,7 @@
             Animation.AppendSerializedAnimations(particleSystem, serializationObject);
 
             // Particle system
+            serializationObject.startDelay = particleSystem.startDelay;
             serializationObject.renderingGroupId = particleSystem.renderingGroupId;
             serializationObject.isBillboardBased = particleSystem.isBillboardBased;
             serializationObject.minAngularSpeed = particleSystem.minAngularSpeed;
@@ -2216,6 +2217,7 @@
             }
 
             // Particle system
+            particleSystem.startDelay = parsedParticleSystem.startDelay | 0;
             particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed;
             particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed;
             particleSystem.minSize = parsedParticleSystem.minSize;