David Catuhe 7 年之前
父節點
當前提交
7cfcb1eac0

+ 3 - 2
src/Particles/babylon.IParticleSystem.ts

@@ -231,9 +231,10 @@ module BABYLON {
         rebuild(): void;
         rebuild(): void;
 
 
         /**
         /**
-         * Starts the particle system and begins to emit.
+         * Starts the particle system and begins to emit
+         * @param delay defines the delay in milliseconds before starting the system (0 by default)
          */
          */
-        start(): void;
+        start(delay?: number): void;
 
 
         /**
         /**
          * Stops the particle system.
          * Stops the particle system.

+ 10 - 3
src/Particles/babylon.gpuParticleSystem.ts

@@ -372,9 +372,16 @@
         }
         }
 
 
         /**
         /**
-         * Starts the particle system and begins to emit.
-         */
-        public start(): void {
+         * Starts the particle system and begins to emit
+         * @param delay defines the delay in milliseconds before starting the system (0 by default)
+         */
+        public start(delay = 0): void {
+            if (delay) {
+                setTimeout(()=> {
+                    this.start(0);
+                }, delay);
+                return;
+            }
             this._started = true;
             this._started = true;
             this._stopped = false;
             this._stopped = false;
             this._preWarmDone = false;
             this._preWarmDone = false;

+ 11 - 3
src/Particles/babylon.particleSystem.ts

@@ -902,9 +902,17 @@
         }
         }
 
 
         /**
         /**
-         * Starts the particle system and begins to emit.
-         */
-        public start(): void {
+         * Starts the particle system and begins to emit
+         * @param delay defines the delay in milliseconds before starting the system (0 by default)
+         */
+        public start(delay = 0): void {
+            if (delay) {
+                setTimeout(()=> {
+                    this.start(0);
+                }, delay);
+                return;
+            }
+
             this._started = true;
             this._started = true;
             this._stopped = false;
             this._stopped = false;
             this._actualFrame = 0;
             this._actualFrame = 0;