mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Merge pull request #2301 from samme/issue-2299
Stop only the named animation if `name` is passed
This commit is contained in:
commit
d6dcd0e5c6
1 changed files with 2 additions and 13 deletions
|
@ -308,21 +308,10 @@ Phaser.AnimationManager.prototype = {
|
|||
|
||||
if (resetFrame === undefined) { resetFrame = false; }
|
||||
|
||||
if (typeof name === 'string')
|
||||
{
|
||||
if (this._anims[name])
|
||||
{
|
||||
this.currentAnim = this._anims[name];
|
||||
this.currentAnim.stop(resetFrame);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.currentAnim)
|
||||
if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name))
|
||||
{
|
||||
this.currentAnim.stop(resetFrame);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue