only start animator if assets are ready
This commit is contained in:
parent
c21c715bf4
commit
5dc39a5e32
@ -27,6 +27,7 @@ var cancelAnimationFrame = global.cancelAnimationFrame
|
|||||||
this._t0 = +new Date();
|
this._t0 = +new Date();
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this._time = 0.0;
|
this._time = 0.0;
|
||||||
|
this.itemsReady = false;
|
||||||
|
|
||||||
this.options = torque.extend({
|
this.options = torque.extend({
|
||||||
animationDelay: 0,
|
animationDelay: 0,
|
||||||
@ -42,9 +43,11 @@ var cancelAnimationFrame = global.cancelAnimationFrame
|
|||||||
Animator.prototype = {
|
Animator.prototype = {
|
||||||
|
|
||||||
start: function() {
|
start: function() {
|
||||||
|
if(this.itemsReady){
|
||||||
this.running = true;
|
this.running = true;
|
||||||
requestAnimationFrame(this._tick);
|
requestAnimationFrame(this._tick);
|
||||||
this.options.onStart && this.options.onStart();
|
this.options.onStart && this.options.onStart();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isRunning: function() {
|
isRunning: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user