Skip to content

Commit 4750e92

Browse files
committed
Fixed a method signature issue with the Animation component's 'remove' event handler.
This prevented removed animations from stopping correctly, when they were removed from the AnimationManager.
1 parent 007ac01 commit 4750e92

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* Fixed `Math.Matrix4.makeRotationAxis()`.
1818
* Fixed an incorrect usage of `Math.abs()` in `Math.Quaternion.calculateW()` (thanks @qxzkjp).
1919
* Particle Emitter Managers can now be added to Containers (thanks @TadejZupancic)
20+
* Fixed a method signature issue with the Animation component's `remove()` handler when `Animation`s are removed from the `AnimationManager`. This prevented removed animations from stopping correctly.
2021

2122
## Version 3.9.0 - Yui - 24th May 2018
2223

src/gameobjects/components/Animation.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,14 @@ var Animation = new Class({
571571
* @method Phaser.GameObjects.Components.Animation#remove
572572
* @since 3.0.0
573573
*
574-
* @param {Phaser.Animations.Animation} [event] - The removed Animation.
574+
* @param {string} [key] - The key of the removed Animation.
575+
* @param {Phaser.Animations.Animation} [animation] - The removed Animation.
575576
*/
576-
remove: function (event)
577+
remove: function (key, animation)
577578
{
578-
if (event === undefined) { event = this.currentAnim; }
579+
if (animation === undefined) { animation = this.currentAnim; }
579580

580-
if (this.isPlaying && event.key === this.currentAnim.key)
581+
if (this.isPlaying && animation.key === this.currentAnim.key)
581582
{
582583
this.stop();
583584

0 commit comments

Comments
 (0)