mirror of
https://github.com/photonstorm/phaser
synced 2024-12-01 08:59:31 +00:00
Added hasTarget method. Also you cannot add a Tween into a Timeline already playing.
This commit is contained in:
parent
1de0242fc7
commit
fb8b428f64
2 changed files with 26 additions and 8 deletions
|
@ -39,9 +39,12 @@ var TweenManager = new Class({
|
|||
{
|
||||
var timeline = TimelineBuilder(this, config);
|
||||
|
||||
if (!timeline.paused)
|
||||
{
|
||||
this._add.push(timeline);
|
||||
|
||||
this._toProcess++;
|
||||
}
|
||||
|
||||
return timeline;
|
||||
},
|
||||
|
|
|
@ -102,6 +102,8 @@ var Timeline = new Class({
|
|||
},
|
||||
|
||||
queue: function (tween)
|
||||
{
|
||||
if (!this.isPlaying())
|
||||
{
|
||||
tween.parent = this;
|
||||
tween.parentIsTimeline = true;
|
||||
|
@ -109,6 +111,7 @@ var Timeline = new Class({
|
|||
this.data.push(tween);
|
||||
|
||||
this.totalData = this.data.length;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
@ -467,13 +470,25 @@ var Timeline = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
hasTarget: function ()
|
||||
hasTarget: function (target)
|
||||
{
|
||||
for (var i = 0; i < this.data.length; i++)
|
||||
{
|
||||
if (this.data[i].hasTarget(target))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
destroy: function ()
|
||||
{
|
||||
for (var i = 0; i < this.data.length; i++)
|
||||
{
|
||||
this.data[i].destroy();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue