Added getTotal test

This commit is contained in:
Richard Davey 2022-08-19 18:49:08 +01:00
parent c72ea9b7f8
commit a13b79f86e

View file

@ -383,7 +383,7 @@ var TweenManager = new Class({
{ {
list.splice(idx, 1); list.splice(idx, 1);
tween.state = TWEEN_CONST.REMOVED; tween.destroy();
} }
} }
@ -502,6 +502,22 @@ var TweenManager = new Class({
return this; return this;
}, },
getTotal: function ()
{
var tweens = this.tweens;
var active = 0;
for (var i = 0; i < tweens.length; i++)
{
if (tweens[i].state === TWEEN_CONST.ACTIVE)
{
active++;
}
}
return { active: active, total: tweens.length };
},
/** /**
* Returns an array containing references to of all Tweens and Timelines in this Tween Manager. * Returns an array containing references to of all Tweens and Timelines in this Tween Manager.
* *