Added ignoreIfPlaying argument to Animation.Play.

This commit is contained in:
photonstorm 2017-06-26 15:08:12 +01:00
parent 44f6d9c1d2
commit 72913b63dd

View file

@ -1,7 +1,13 @@
var Play = function (key, startFrame) var Play = function (key, ignoreIfPlaying, startFrame)
{ {
if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }
if (startFrame === undefined) { startFrame = 0; } if (startFrame === undefined) { startFrame = 0; }
if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key)
{
return this;
}
this.load(key, startFrame); this.load(key, startFrame);
var anim = this.currentAnim; var anim = this.currentAnim;