Fix Animation component pause()

This commit is contained in:
Antriel 2018-04-13 09:58:33 +02:00
parent 9cfda8a7b0
commit b52707f79d

View file

@ -817,24 +817,26 @@ var Animation = new Class({
*/
update: function (timestamp, delta)
{
if (this.currentAnim && (this.isPlaying || !this.currentAnim.paused))
if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused)
{
this.accumulator += delta * this._timeScale;
return;
}
if (this._pendingStop === 1)
this.accumulator += delta * this._timeScale;
if (this._pendingStop === 1)
{
this._pendingStopValue -= delta;
if (this._pendingStopValue <= 0)
{
this._pendingStopValue -= delta;
if (this._pendingStopValue <= 0)
{
return this.currentAnim.completeAnimation(this);
}
return this.currentAnim.completeAnimation(this);
}
}
if (this.accumulator >= this.nextTick)
{
this.currentAnim.setFrame(this);
}
if (this.accumulator >= this.nextTick)
{
this.currentAnim.setFrame(this);
}
},