Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc.loader.loadResArray type supports Array #3312

Merged
merged 2 commits into from Oct 11, 2018

Conversation

Projects
None yet
3 participants
@caochao
Copy link
Contributor

caochao commented Sep 26, 2018

如图所示
image

从resources目录动态加载龙骨资源时,因为导出文件中其中两个名字相同,仅仅是后缀类型不同。且由于loadResArray第2个参数资源类型Type只能传一个,导致没法批量加载。建议loadResArray第2个参数能传入类型数组。

@pandamicro
Copy link
Member

pandamicro left a comment

感谢贡献,请做一下简单的调整,我们会合并

@@ -581,12 +581,13 @@ proto.loadResArray = function (urls, type, progressCallback, completeCallback) {
var uuids = [];
for (var i = 0; i < urls.length; i++) {
var url = urls[i];
var uuid = this._getResUuid(url, type);
var assetType = (type instanceof Array) ? type[i] : type;

This comment has been minimized.

Copy link
@pandamicro

pandamicro Sep 29, 2018

Member

建议在 for 循环之外做 instanceof Array 判断,缓存结果,在这里复用

@pandamicro pandamicro changed the title cc.loader.loadResArray类型参数支持数组 cc.loader.loadResArray type supports Array Sep 29, 2018

@jareguo

This comment has been minimized.

Copy link
Contributor

jareguo commented Oct 8, 2018

哈罗,在吗? @caochao

@caochao

This comment has been minimized.

Copy link
Contributor Author

caochao commented Oct 10, 2018

好的,调整过的已提交

@pandamicro pandamicro merged commit ad35dba into cocos-creator:v2.0-release Oct 11, 2018

1 check passed

ci/circleci: test Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.