mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 15:41:37 +00:00
Timeline onStarts fire when offset expires.
This commit is contained in:
parent
6fe38a1c51
commit
1de0242fc7
2 changed files with 33 additions and 7 deletions
|
@ -7,12 +7,21 @@ var Play = function (resetFromTimeline)
|
|||
return;
|
||||
}
|
||||
|
||||
var onStart = this.callbacks.onStart;
|
||||
|
||||
if (this.parentIsTimeline)
|
||||
{
|
||||
this.resetTweenData(resetFromTimeline);
|
||||
|
||||
if (this.calculatedOffset === 0)
|
||||
{
|
||||
if (onStart)
|
||||
{
|
||||
onStart.params[1] = this.targets;
|
||||
|
||||
onStart.func.apply(onStart.scope, onStart.params);
|
||||
}
|
||||
|
||||
this.state = TWEEN_CONST.ACTIVE;
|
||||
}
|
||||
else
|
||||
|
@ -35,15 +44,13 @@ var Play = function (resetFromTimeline)
|
|||
this.resetTweenData(false);
|
||||
|
||||
this.state = TWEEN_CONST.ACTIVE;
|
||||
}
|
||||
|
||||
var onStart = this.callbacks.onStart;
|
||||
if (onStart)
|
||||
{
|
||||
onStart.params[1] = this.targets;
|
||||
|
||||
if (onStart)
|
||||
{
|
||||
onStart.params[1] = this.targets;
|
||||
|
||||
onStart.func.apply(onStart.scope, onStart.params);
|
||||
onStart.func.apply(onStart.scope, onStart.params);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -46,12 +46,31 @@ var Update = function (timestamp, delta)
|
|||
break;
|
||||
|
||||
case TWEEN_CONST.LOOP_DELAY:
|
||||
|
||||
this.countdown -= delta;
|
||||
|
||||
if (this.countdown <= 0)
|
||||
{
|
||||
this.state = TWEEN_CONST.ACTIVE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TWEEN_CONST.OFFSET_DELAY:
|
||||
|
||||
this.countdown -= delta;
|
||||
|
||||
if (this.countdown <= 0)
|
||||
{
|
||||
var onStart = this.callbacks.onStart;
|
||||
|
||||
if (onStart)
|
||||
{
|
||||
onStart.params[1] = this.targets;
|
||||
|
||||
onStart.func.apply(onStart.scope, onStart.params);
|
||||
}
|
||||
|
||||
this.state = TWEEN_CONST.ACTIVE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue