mirror of
https://github.com/photonstorm/phaser
synced 2024-12-01 08:59:31 +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
|
@ -6,6 +6,8 @@ var Play = function (resetFromTimeline)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var onStart = this.callbacks.onStart;
|
||||
|
||||
if (this.parentIsTimeline)
|
||||
{
|
||||
|
@ -13,6 +15,13 @@ var Play = function (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