Lewy Blue 5 лет назад
Родитель
Сommit
0cdc91d313
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      docs/api/zh/loaders/Loader.html

+ 12 - 0
docs/api/zh/loaders/Loader.html

@@ -57,6 +57,18 @@
 			This method needs to be implement by all concrete loaders. It holds the logic for loading the asset from the backend.
 			This method needs to be implement by all concrete loaders. It holds the logic for loading the asset from the backend.
 		</p>
 		</p>
 
 
+		<h3>[method:Promise loadAsync]( [param:String url], [param:Function onProgress] )</h3>
+		<p>
+		[page:String url] — A string containing the path/URL of the <em>.gltf</em> or <em>.glb</em> file.<br />
+		[page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		</p>
+		<p>
+		This method is equivalent to [page:.load], but returns a [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise].
+		</p>
+		<p>
+		[page:Function onLoad] is handled by [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve Promise.resolve] and [page:Function onError] is handled by [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject Promise.reject].
+		</p>
+
 		<h3>[method:void parse]()</h3>
 		<h3>[method:void parse]()</h3>
 		<p>
 		<p>
 			This method needs to be implement by all concrete loaders. It holds the logic for parsing the asset into three.js entities.
 			This method needs to be implement by all concrete loaders. It holds the logic for parsing the asset into three.js entities.

粤ICP备19079148号