[]load完成后能否获取到具体是哪个对象资源完成
this.LoadAsset("res/LayaScene_H5TestScene/H5TestScene.ls");
private LoadAsset(path: string): void {
Laya.loader.create(path, Laya.Handler.create(this, this.OnAssetComplete));
}
private OnAssetComplete(): void {
console.log("on asset complete:");
}
我想在OnAssetComplete内知道是哪个资源被回调了,请问要怎样处理,是否有现成的接口,我看了一下文档,没发现才提问
private LoadAsset(path: string): void {
Laya.loader.create(path, Laya.Handler.create(this, this.OnAssetComplete));
}
private OnAssetComplete(): void {
console.log("on asset complete:");
}
我想在OnAssetComplete内知道是哪个资源被回调了,请问要怎样处理,是否有现成的接口,我看了一下文档,没发现才提问
没有找到相关结果
已邀请:
2 个回复
hejianchun
赞同来自:
let arg = [{ lPath: path, lType: type }];
if (type == AssetType.Type3D) {
Laya.loader.create(path, Laya.Handler.create(this, this.OnAssetComplete, arg));
}
private OnAssetComplete(arg: any): void {
let path: string = arg.lPath;
let type: AssetType = arg.lType;
}
Aar0n
赞同来自: