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.callback = callback;
|
||||
this._time = 0.0;
|
||||
this.itemsReady = false;
|
||||
|
||||
this.options = torque.extend({
|
||||
animationDelay: 0,
|
||||
@ -42,9 +43,11 @@ var cancelAnimationFrame = global.cancelAnimationFrame
|
||||
Animator.prototype = {
|
||||
|
||||
start: function() {
|
||||
if(this.itemsReady){
|
||||
this.running = true;
|
||||
requestAnimationFrame(this._tick);
|
||||
this.options.onStart && this.options.onStart();
|
||||
}
|
||||
},
|
||||
|
||||
isRunning: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user