Browse Source

Make downloads restart

Garrett Johnson 5 years ago
parent
commit
addf739dd9
1 changed files with 13 additions and 4 deletions
  1. 13 4
      example/index.js

+ 13 - 4
example/index.js

@@ -225,7 +225,19 @@ function init() {
 	exampleOptions.add( params, 'orthographic' );
 	exampleOptions.add( params, 'showThirdPerson' );
 	exampleOptions.add( params, 'showSecondView' ).onChange( onWindowResize );
-	exampleOptions.add( params, 'enableUpdate' );
+	exampleOptions.add( params, 'enableUpdate' ).onChange( v => {
+
+		tiles.parseQueue.autoUpdate = v;
+		tiles.downloadQueue.autoUpdate = v;
+
+		if ( v ) {
+
+			tiles.parseQueue.scheduleJobRun();
+			tiles.downloadQueue.scheduleJobRun();
+
+		}
+
+	} );
 	exampleOptions.add( params, 'enableRaycast' );
 	exampleOptions.add( params, 'enableCacheDisplay' );
 	exampleOptions.open();
@@ -499,9 +511,6 @@ function animate() {
 
 	}
 
-	tiles.downloadQueue.autoUpdate = params.enableUpdate;
-	tiles.parseQueue.autoUpdate = params.enableUpdate;
-
 	render();
 	stats.update();