Skip to content

5.2.5可以,5.2.10版本不能使用。 #1

@l2xin

Description

@l2xin

5.2.5可以,5.2.10版本不能使用。你的工程运行结果如下:

load json default.res.json
Main.ts:78 load json config/1.json
Main.ts:78 load json config/2.json
Main.ts:78 load json config/3.json
Main.ts:78 load json config/4.json
  • 问题1:
    RES.config.config.resourceRoot; RES.config已经没有

  • 问题2:
    5.2.10加了这句data["root"] = ''; ,我自己把去掉了。

 Resource.prototype.addResourceData = function (data) {
	//fixed by l2xin 不明白为什么
        //data["root"] = '';
        RES.config.addResourceData(data);
 };
  • 问题3:

下面这样写3个文件是ok的,多加一个就失败

if (!RES.hasRes(name)) {
    const url = "total.json";
    const type = 'json';
    const root = "resource/"; //ResourceManager.Instance.ResourceRoot;
    const resource = { name, url, type, root };
    RES.$addResourceData(resource);
    await RES.getResAsync(name);
    this.totalContent = RES.getRes(name);
}
else {
    if (this.totalContent == null) {
        await RES.getResAsync(name);
        this.totalContent = RES.getRes(name);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions