浏览代码

Minor tweak to post load order

Gary Hsu 9 年之前
父节点
当前提交
fcf4c84395
共有 2 个文件被更改,包括 16 次插入16 次删除
  1. 8 8
      loaders/glTF/babylon.glTFFileLoader.js
  2. 8 8
      loaders/glTF/babylon.glTFFileLoader.ts

+ 8 - 8
loaders/glTF/babylon.glTFFileLoader.js

@@ -1370,10 +1370,10 @@ var BABYLON;
                         skeletons.push(skin.babylonSkeleton);
                     }
                 }
-                // Load shaders and then buffers
-                _this._loadShadersAsync(gltfRuntime, function () {
-                    importMaterials(gltfRuntime);
-                    _this._loadBuffersAsync(gltfRuntime, function () {
+                // Load buffers, shaders, materials, etc.
+                _this._loadBuffersAsync(gltfRuntime, function () {
+                    _this._loadShadersAsync(gltfRuntime, function () {
+                        importMaterials(gltfRuntime);
                         onBuffersLoaded(gltfRuntime);
                     });
                 });
@@ -1392,10 +1392,10 @@ var BABYLON;
             BABYLON.GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
                 // Create nodes
                 _this._createNodes(gltfRuntime);
-                // Load shaders and then buffers
-                _this._loadShadersAsync(gltfRuntime, function () {
-                    importMaterials(gltfRuntime);
-                    _this._loadBuffersAsync(gltfRuntime, function () {
+                // Load buffers, shaders, materials, etc.
+                _this._loadBuffersAsync(gltfRuntime, function () {
+                    _this._loadShadersAsync(gltfRuntime, function () {
+                        importMaterials(gltfRuntime);
                         onBuffersLoaded(gltfRuntime);
                     });
                 });

+ 8 - 8
loaders/glTF/babylon.glTFFileLoader.ts

@@ -1573,10 +1573,10 @@
                     }
                 }
 
-                // Load shaders and then buffers
-                this._loadShadersAsync(gltfRuntime, () => {
-                    importMaterials(gltfRuntime);
-                    this._loadBuffersAsync(gltfRuntime, () => {
+                // Load buffers, shaders, materials, etc.
+                this._loadBuffersAsync(gltfRuntime, () => {
+                    this._loadShadersAsync(gltfRuntime, () => {
+                        importMaterials(gltfRuntime);
                         onBuffersLoaded(gltfRuntime);
                     });
                 });
@@ -1599,10 +1599,10 @@
                 // Create nodes
                 this._createNodes(gltfRuntime);
 
-                // Load shaders and then buffers
-                this._loadShadersAsync(gltfRuntime, () => {
-                    importMaterials(gltfRuntime);
-                    this._loadBuffersAsync(gltfRuntime, () => {
+                // Load buffers, shaders, materials, etc.
+                this._loadBuffersAsync(gltfRuntime, () => {
+                    this._loadShadersAsync(gltfRuntime, () => {
+                        importMaterials(gltfRuntime);
                         onBuffersLoaded(gltfRuntime);
                     });
                 });