Selaa lähdekoodia

Add `onLoadTileSet` callback

(cherry picked from commit 1f6961e3c80d55a182f870febdd851cffc0752a0)
Garrett Johnson 5 vuotta sitten
vanhempi
commit
aebf33b00a
1 muutettua tiedostoa jossa 17 lisäystä ja 0 poistoa
  1. 17 0
      src/three/TilesRenderer.js

+ 17 - 0
src/three/TilesRenderer.js

@@ -82,6 +82,7 @@ export class TilesRenderer extends TilesRendererBase {
 		this.visibleTiles = new Set();
 		this._autoDisableRendererCulling = true;
 
+		this.onLoadTileSet = null;
 		this.onLoadModel = null;
 		this.onDisposeModel = null;
 
@@ -255,6 +256,22 @@ export class TilesRenderer extends TilesRendererBase {
 	}
 
 	/* Overriden */
+	loadTileSet( url ) {
+
+		const pr = super( url );
+		pr.then(() => {
+
+			if ( this.onLoadTileSet ) {
+
+				this.onLoadTileSet( this.tileSets[ url ] );
+
+			}
+
+		});
+		return pr;
+
+	}
+
 	update() {
 
 		const group = this.group;