|
@@ -27,7 +27,7 @@
|
|
|
load: (scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void) => boolean;
|
|
|
canDirectLoad?: (data: string) => boolean;
|
|
|
rewriteRootURL?: (rootUrl: string, responseURL?: string) => string;
|
|
|
- loadAssets: (scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void) => AssetContainer;
|
|
|
+ loadAssets: (scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void) => Nullable<AssetContainer>;
|
|
|
}
|
|
|
|
|
|
export interface ISceneLoaderPluginAsync {
|
|
@@ -37,7 +37,7 @@
|
|
|
loadAsync: (scene: Scene, data: string, rootUrl: string, onSuccess?: () => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void) => void;
|
|
|
canDirectLoad?: (data: string) => boolean;
|
|
|
rewriteRootURL?: (rootUrl: string, responseURL?: string) => string;
|
|
|
- loadAssetsAsync: (scene: Scene, data: string, rootUrl: string, onSuccess?: (assets: AssetContainer) => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void) => void;
|
|
|
+ loadAssetsAsync: (scene: Scene, data: string, rootUrl: string, onSuccess?: (assets: Nullable<AssetContainer>) => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void) => void;
|
|
|
}
|
|
|
|
|
|
interface IRegisteredPlugin {
|
|
@@ -526,8 +526,10 @@
|
|
|
} else {
|
|
|
var asyncedPlugin = <ISceneLoaderPluginAsync>plugin;
|
|
|
asyncedPlugin.loadAssetsAsync(scene, data, rootUrl, (assetContainer) => {
|
|
|
- scene.loadingPluginName = plugin.name;
|
|
|
- successHandler(assetContainer);
|
|
|
+ if(assetContainer){
|
|
|
+ scene.loadingPluginName = plugin.name;
|
|
|
+ successHandler(assetContainer);
|
|
|
+ }
|
|
|
}, progressHandler, errorHandler);
|
|
|
}
|
|
|
|