[]我二进制资源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);
}
已邀请:

fengzv

赞同来自:

在chrome开发者工具network中看着这个data.txt加载时成功的 http状态吗为200

fengzv

赞同来自:

cfg 显示的是undefined

bq49

赞同来自:

解决了吗?兄弟,我也遇到这个问题了。一模一样。。。

要回复问题请先

商务合作
商务合作