|
|
@ -136,6 +136,9 @@ export class BabylonTool { |
|
|
|
console.log("异步加载模型" + path + sceneFilename); |
|
|
|
console.log("异步加载模型" + path + sceneFilename); |
|
|
|
let modelPath = path + sceneFilename; |
|
|
|
let modelPath = path + sceneFilename; |
|
|
|
LoadTool.add(modelPath, tag); |
|
|
|
LoadTool.add(modelPath, tag); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let isSuccess = false; |
|
|
|
|
|
|
|
let plugin = |
|
|
|
SceneLoader.ImportMeshAsync( |
|
|
|
SceneLoader.ImportMeshAsync( |
|
|
|
meshNames, |
|
|
|
meshNames, |
|
|
|
path, |
|
|
|
path, |
|
|
@ -144,11 +147,23 @@ export class BabylonTool { |
|
|
|
onProgress, |
|
|
|
onProgress, |
|
|
|
).then(function (result) { |
|
|
|
).then(function (result) { |
|
|
|
LoadTool.remove(modelPath); |
|
|
|
LoadTool.remove(modelPath); |
|
|
|
|
|
|
|
isSuccess = true; |
|
|
|
onSuccess(result.meshes, result.particleSystems, result.skeletons, result.animationGroups); |
|
|
|
onSuccess(result.meshes, result.particleSystems, result.skeletons, result.animationGroups); |
|
|
|
}).catch(function (result) { |
|
|
|
}).catch(function (result) { |
|
|
|
onError(scene, "load error", result); |
|
|
|
onError(scene, "load error", result); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (isSuccess == false) {
|
|
|
|
|
|
|
|
// (plugin as any)?.onDisposeObservable?.notifyObservers(plugin);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }, 1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|