Explorar o código

ParticleSystem On Animation End Callback

Fixed on animation end callback handler
MackeyK24 %!s(int64=8) %!d(string=hai) anos
pai
achega
720e457a9a
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  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 {