Browse Source

Particle System Animation End

Added animation end callback support
MackeyK24 8 years ago
parent
commit
dcb300cf27
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/Particles/babylon.particleSystem.ts

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

@@ -73,6 +73,7 @@
         }
         }
 
 
         public updateFunction: (particles: Particle[]) => void;
         public updateFunction: (particles: Particle[]) => void;
+        public onAnimationEnd: () => void = null;
 
 
         public blendMode = ParticleSystem.BLENDMODE_ONEONE;
         public blendMode = ParticleSystem.BLENDMODE_ONEONE;
 
 
@@ -390,6 +391,11 @@
             }
             }
 
 
             this._vertexBuffer.update(this._vertexData);
             this._vertexBuffer.update(this._vertexData);
+
+            // Animation End
+            if (this.onAnimationEnd != null) {
+                this.onAnimationEnd();
+            }
         }
         }
 
 
         public render(): number {
         public render(): number {