mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 15:41:37 +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);
|
||||
|
||||
this._add.push(timeline);
|
||||
if (!timeline.paused)
|
||||
{
|
||||
this._add.push(timeline);
|
||||
|
||||
this._toProcess++;
|
||||
this._toProcess++;
|
||||
}
|
||||
|
||||
return timeline;
|
||||
},
|
||||
|
|
|
@ -103,12 +103,15 @@ var Timeline = new Class({
|
|||
|
||||
queue: function (tween)
|
||||
{
|
||||
tween.parent = this;
|
||||
tween.parentIsTimeline = true;
|
||||
if (!this.isPlaying())
|
||||
{
|
||||
tween.parent = this;
|
||||
tween.parentIsTimeline = true;
|
||||
|
||||
this.data.push(tween);
|
||||
this.data.push(tween);
|
||||
|
||||
this.totalData = this.data.length;
|
||||
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