Browse Source

ParticleSystem On Animation End Callback

Fixed on animation end callback handler
MackeyK24 8 years ago
parent
commit
720e457a9a
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/Particles/babylon.particleSystem.ts

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

@@ -373,6 +373,9 @@
             if (this._stopped) {
                 if (!this._alive) {
                     this._started = false;
+                    if (this.onAnimationEnd) {
+                        this.onAnimationEnd();
+                    }
                     if (this.disposeOnStop) {
                         this._scene._toBeDisposed.push(this);
                     }
@@ -391,11 +394,6 @@
             }
 
             this._vertexBuffer.update(this._vertexData);
-
-            // Animation End
-            if (this.onAnimationEnd != null) {
-                this.onAnimationEnd();
-            }
         }
 
         public render(): number {