Skip to content

Commit e2c08dd

Browse files
committed
Added Tween.repeatDelay.
1 parent 9f651da commit e2c08dd

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '673b3ff0-3ab4-11e7-a771-cbff81527fed'
2+
build: '48abf510-3ab5-11e7-94f8-f16a04e0b1e8'
33
};
44
module.exports = CHECKSUM;

v3/src/tween/Tween.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,13 @@ Tween.prototype = {
7373
return;
7474
}
7575

76+
this.loadValues();
77+
7678
if (this.delay > 0)
7779
{
7880
this.countdown = this.delay;
7981
this.state = 2;
8082
}
81-
else
82-
{
83-
this.loadValues();
84-
}
8583
},
8684

8785
loadValues: function ()
@@ -109,8 +107,7 @@ Tween.prototype = {
109107

110108
if (this.countdown <= 0)
111109
{
112-
// Refactor this, so we can use countdown for repeatDelay and onCompleteDelay as well
113-
this.loadValues();
110+
this.state = 3;
114111
}
115112
}
116113

@@ -216,7 +213,17 @@ Tween.prototype = {
216213
this.elapsed = 0;
217214
this.progress = 0;
218215

219-
return 3;
216+
// Delay?
217+
if (this.repeatDelay > 0)
218+
{
219+
this.countdown = this.repeatDelay;
220+
221+
return 2;
222+
}
223+
else
224+
{
225+
return 3;
226+
}
220227
}
221228

222229
return 5;

v3/src/tween/TweenBuilder.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ var TweenBuilder = function (manager, config)
150150
var duration = GetAdvancedValue(config, 'duration', 1000);
151151
var yoyo = GetValue(config, 'yoyo', false);
152152
var repeat = GetAdvancedValue(config, 'repeat', 0);
153+
var repeatDelay = GetAdvancedValue(config, 'repeatDelay', 0);
153154
var loop = GetValue(config, 'loop', false);
154155
var delay = GetAdvancedValue(config, 'delay', 0);
155156

@@ -166,6 +167,7 @@ var TweenBuilder = function (manager, config)
166167
var iDuration = GetAdvancedValue(value, 'duration', duration);
167168
var iYoyo = GetValue(value, 'yoyo', yoyo);
168169
var iRepeat = GetAdvancedValue(value, 'repeat', repeat);
170+
var iRepeatDelay = GetAdvancedValue(value, 'repeatDelay', repeatDelay);
169171
var iLoop = GetValue(value, 'loop', loop);
170172
var iDelay = GetAdvancedValue(value, 'delay', delay);
171173

@@ -181,6 +183,7 @@ var TweenBuilder = function (manager, config)
181183
tween.duration = iDuration;
182184
tween.yoyo = iYoyo;
183185
tween.repeat = iRepeat;
186+
tween.repeatDelay = iRepeatDelay;
184187
tween.loop = iLoop;
185188
tween.delay = iDelay;
186189

0 commit comments

Comments
 (0)