diff --git a/v3/src/tween/tween/components/Play.js b/v3/src/tween/tween/components/Play.js index 98d8079d9..60c54df9e 100644 --- a/v3/src/tween/tween/components/Play.js +++ b/v3/src/tween/tween/components/Play.js @@ -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); + } } }; diff --git a/v3/src/tween/tween/components/Update.js b/v3/src/tween/tween/components/Update.js index 1b67a32c2..9fbb1f001 100644 --- a/v3/src/tween/tween/components/Update.js +++ b/v3/src/tween/tween/components/Update.js @@ -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; }