瀏覽代碼

GLTFLoader: add parseAsync (#22754)

Marco Fugaro 3 年之前
父節點
當前提交
24a2509061
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      examples/jsm/loaders/GLTFLoader.js

+ 12 - 0
examples/jsm/loaders/GLTFLoader.js

@@ -385,6 +385,18 @@ class GLTFLoader extends Loader {
 
 	}
 
+	parseAsync( data, path ) {
+
+		const scope = this;
+
+		return new Promise( function ( resolve, reject ) {
+
+			scope.parse( data, path, resolve, reject );
+
+		} );
+
+	}
+
 }
 
 /* GLTFREGISTRY */