Browse Source

Only dynamically load decoder when DracoDecoderModule is undefined

Fan Zhang 7 years ago
parent
commit
ee7b9853a9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      examples/js/loaders/draco/DRACOLoader.js

+ 3 - 1
examples/js/loaders/draco/DRACOLoader.js

@@ -28,7 +28,9 @@ THREE.DRACOLoader = function(dracoPath, dracoDecoderType, manager) {
         (dracoDecoderType !== undefined) ? dracoDecoderType : {};
         (dracoDecoderType !== undefined) ? dracoDecoderType : {};
     this.drawMode = THREE.TrianglesDrawMode;
     this.drawMode = THREE.TrianglesDrawMode;
     this.dracoSrcPath = (dracoPath !== undefined) ? dracoPath : './';
     this.dracoSrcPath = (dracoPath !== undefined) ? dracoPath : './';
-    THREE.DRACOLoader.loadDracoDecoder(this);
+    if (typeof DracoDecoderModule === 'undefined') {
+      THREE.DRACOLoader.loadDracoDecoder(this);
+    }
 };
 };
 
 
 THREE.DRACOLoader.prototype = {
 THREE.DRACOLoader.prototype = {