mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
AnimationManager.play will now call Animation.stop on the current animation before switching to the new one (thanks @nihakue, #713)
This commit is contained in:
parent
5d0ea6453b
commit
25a93cf4af
2 changed files with 7 additions and 1 deletions
|
@ -63,6 +63,7 @@ Version 2.0.4 - "Mos Shirare" - in development
|
|||
* Timer has removed all use of local temporary vars in the core update loop.
|
||||
* The Input.reset `hard` reset parameter is now passed down to the Keyboard and Key reset methods.
|
||||
* AnimationManager.destroy now iterates through child animations calling destroy on all of them, avoiding a memory leak (thanks stauzs)
|
||||
* AnimationManager.play will now call Animation.stop on the current animation before switching to the new one (thanks @nihakue, #713)
|
||||
|
||||
|
||||
### New Features
|
||||
|
|
|
@ -195,7 +195,7 @@ Phaser.AnimationManager.prototype = {
|
|||
|
||||
if (this._anims[name])
|
||||
{
|
||||
if (this.currentAnim == this._anims[name])
|
||||
if (this.currentAnim === this._anims[name])
|
||||
{
|
||||
if (this.currentAnim.isPlaying === false)
|
||||
{
|
||||
|
@ -205,6 +205,11 @@ Phaser.AnimationManager.prototype = {
|
|||
}
|
||||
else
|
||||
{
|
||||
if (this.currentAnim && this.currentAnim.isPlaying)
|
||||
{
|
||||
this.currentAnim.stop();
|
||||
}
|
||||
|
||||
this.currentAnim = this._anims[name];
|
||||
this.currentAnim.paused = false;
|
||||
return this.currentAnim.play(frameRate, loop, killOnComplete);
|
||||
|
|
Loading…
Reference in a new issue