瀏覽代碼

ParticleSystem On Animation End Callback

Fixed on animation end callback handler
MackeyK24 8 年之前
父節點
當前提交
720e457a9a
共有 1 個文件被更改,包括 3 次插入5 次删除
  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 {