修复resLoader.loadRemote方加载远程资源未生效果问题

This commit is contained in:
dgflash
2022-04-29 20:08:20 +08:00
parent f13fba3d83
commit aea7701ebb
3 changed files with 12 additions and 5 deletions

View File

@@ -227,7 +227,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 474.1565217391304,
"_orthoHeight": 375,
"_near": 1,
"_far": 2000,
"_color": {

View File

@@ -26,7 +26,5 @@ export class Main extends Root {
if (JSB) {
oops.gui.toast("热更新后新程序的提示");
}
// console.log(protobuf);
}
}

View File

@@ -152,8 +152,17 @@ export default class ResLoader {
public loadRemote<T extends Asset>(url: string, options: IRemoteOptions | null, onComplete?: CompleteCallback<T> | null): void;
public loadRemote<T extends Asset>(url: string, onComplete?: CompleteCallback<T> | null): void;
public loadRemote(url: string, ...args: any): void {
assetManager.loadRemote(url, args);
public loadRemote<T extends Asset>(url: string, ...args: any): void {
var options: IRemoteOptions | null = null;
var onComplete: CompleteCallback<T> | null = null;
if (args.length == 2) {
options = args[0];
onComplete = args[1];
}
else {
onComplete = args[0];
}
assetManager.loadRemote<T>(url, options, onComplete);
}
public release(path: string, bundleName: string = "resources") {