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.
This commit is contained in:
Chris Andrew 2018-06-01 14:37:15 +01:00
parent 007ac01f10
commit 4750e92be4
2 changed files with 6 additions and 4 deletions

View file

@ -17,6 +17,7 @@
* Fixed `Math.Matrix4.makeRotationAxis()`.
* Fixed an incorrect usage of `Math.abs()` in `Math.Quaternion.calculateW()` (thanks @qxzkjp).
* Particle Emitter Managers can now be added to Containers (thanks @TadejZupancic)
* 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.
## Version 3.9.0 - Yui - 24th May 2018

View file

@ -571,13 +571,14 @@ var Animation = new Class({
* @method Phaser.GameObjects.Components.Animation#remove
* @since 3.0.0
*
* @param {Phaser.Animations.Animation} [event] - The removed Animation.
* @param {string} [key] - The key of the removed Animation.
* @param {Phaser.Animations.Animation} [animation] - The removed Animation.
*/
remove: function (event)
remove: function (key, animation)
{
if (event === undefined) { event = this.currentAnim; }
if (animation === undefined) { animation = this.currentAnim; }
if (this.isPlaying && event.key === this.currentAnim.key)
if (this.isPlaying && animation.key === this.currentAnim.key)
{
this.stop();