mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +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,20 +308,9 @@ Phaser.AnimationManager.prototype = {
|
|||
|
||||
if (resetFrame === undefined) { resetFrame = false; }
|
||||
|
||||
if (typeof name === 'string')
|
||||
if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name))
|
||||
{
|
||||
if (this._anims[name])
|
||||
{
|
||||
this.currentAnim = this._anims[name];
|
||||
this.currentAnim.stop(resetFrame);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.currentAnim)
|
||||
{
|
||||
this.currentAnim.stop(resetFrame);
|
||||
}
|
||||
this.currentAnim.stop(resetFrame);
|
||||
}
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue