Bladeren bron

Particle System Animation End

Added animation end callback support
MackeyK24 8 jaren geleden
bovenliggende
commit
dcb300cf27
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  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 onAnimationEnd: () => void = null;
 
         public blendMode = ParticleSystem.BLENDMODE_ONEONE;
 
@@ -390,6 +391,11 @@
             }
 
             this._vertexBuffer.update(this._vertexData);
+
+            // Animation End
+            if (this.onAnimationEnd != null) {
+                this.onAnimationEnd();
+            }
         }
 
         public render(): number {