Selaa lähdekoodia

Merge pull request #3615 from pbalmasov/patch-2

Update babylon.node.ts
David Catuhe 7 vuotta sitten
vanhempi
commit
752d15c5f4
1 muutettua tiedostoa jossa 11 lisäystä ja 3 poistoa
  1. 11 3
      src/babylon.node.ts

+ 11 - 3
src/babylon.node.ts

@@ -411,14 +411,22 @@
             return this._ranges[name];
         }
 
-        public beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): void {
+        /**
+         * Will start the animation sequence
+         * @param {string} name - range frames for animation sequence
+         * @param {boolean} [loop] - should the animation loop
+         * @param {number} [speedRatio] - the speed in which to run the animation
+         * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
+         * Returns {BABYLON.Animatable} the animatable object created for this animation, if range not exists will return null
+         */
+        public beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Animatable? {
             var range = this.getAnimationRange(name);
 
             if (!range) {
-                return;
+                return null;
             }
 
-            this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);
+            return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);
         }
 
         public serializeAnimationRanges(): any {