瀏覽代碼

Only dynamically load decoder when DracoDecoderModule is undefined

Fan Zhang 7 年之前
父節點
當前提交
ee7b9853a9
共有 1 個文件被更改,包括 3 次插入1 次删除
  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 : {};
     this.drawMode = THREE.TrianglesDrawMode;
     this.dracoSrcPath = (dracoPath !== undefined) ? dracoPath : './';
-    THREE.DRACOLoader.loadDracoDecoder(this);
+    if (typeof DracoDecoderModule === 'undefined') {
+      THREE.DRACOLoader.loadDracoDecoder(this);
+    }
 };
 
 THREE.DRACOLoader.prototype = {