[]我二进制资源load之后,为什么通过getRes获取不到。
游戏有个loading页面 我通过load方法把资源全部load之后,在complete方法中通过getRes方法获取不到。部分代码如下:
var resources = [ {
url: "res/atlas/images/guide.atlas",
type: Laya.Loader.ATLAS
}, {
url: "config/data.txt",
type: Laya.Loader.BUFFER
}];
Laya.loader.load(resources, Handler.create(this, this.onComplete), Handler.create(this, this.onProcess), null, 1, false);
}
onComplete(e,a,b) {
console.log('资源加载完成!!',e,a,b);
var cfg = Laya.Loader.getRes("config/data.txt");
console.log('cfg===',cfg, Laya.Loader.groupMap);
}
var resources = [ {
url: "res/atlas/images/guide.atlas",
type: Laya.Loader.ATLAS
}, {
url: "config/data.txt",
type: Laya.Loader.BUFFER
}];
Laya.loader.load(resources, Handler.create(this, this.onComplete), Handler.create(this, this.onProcess), null, 1, false);
}
onComplete(e,a,b) {
console.log('资源加载完成!!',e,a,b);
var cfg = Laya.Loader.getRes("config/data.txt");
console.log('cfg===',cfg, Laya.Loader.groupMap);
}
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
fengzv
赞同来自:
fengzv
赞同来自:
bq49
赞同来自: