mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Merge pull request #1853 from pandamicro/master
[Editor] Fix aliased item couldn't be retrieved issue
This commit is contained in:
@@ -226,7 +226,7 @@ proto.load = function(resources, progressCallback, completeCallback) {
|
||||
var res = getResWithUrl(resource);
|
||||
if (!res.url && !res.uuid)
|
||||
continue;
|
||||
var item = this.getItem(res.url);
|
||||
var item = this._cache[res.url];
|
||||
_sharedResources.push(item || res);
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ proto.flowInDeps = function (owner, urlList, callback) {
|
||||
var res = getResWithUrl(urlList[i]);
|
||||
if (!res.url && ! res.uuid)
|
||||
continue;
|
||||
var item = this.getItem(res.url);
|
||||
var item = this._cache[res.url];
|
||||
if (item) {
|
||||
_sharedList.push(item);
|
||||
}
|
||||
@@ -647,7 +647,7 @@ proto.getRes = function (url, type) {
|
||||
}
|
||||
}
|
||||
if (item && item.alias) {
|
||||
item = this._cache[item.alias];
|
||||
item = item.alias;
|
||||
}
|
||||
return (item && item.complete) ? item.content : null;
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ AssetLoader.prototype.handle = function (item, callback) {
|
||||
url: url,
|
||||
type: ext,
|
||||
error: null,
|
||||
alias: item.id,
|
||||
alias: item,
|
||||
complete: true
|
||||
};
|
||||
if (CC_EDITOR) {
|
||||
|
||||
@@ -595,7 +595,7 @@ proto.getContent = function (id) {
|
||||
ret = item.content;
|
||||
}
|
||||
else if (item.alias) {
|
||||
ret = this.getContent(item.alias);
|
||||
ret = item.alias.content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ proto.getError = function (id) {
|
||||
if (item.error) {
|
||||
ret = item.error;
|
||||
} else if (item.alias) {
|
||||
ret = this.getError(item.alias);
|
||||
ret = item.alias.error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,8 +688,8 @@ proto.removeItem = function (url) {
|
||||
delete this.completed[url];
|
||||
delete this.map[url];
|
||||
if (item.alias) {
|
||||
delete this.completed[item.alias];
|
||||
delete this.map[item.alias];
|
||||
delete this.completed[item.alias.id];
|
||||
delete this.map[item.alias.id];
|
||||
}
|
||||
|
||||
this.completedCount--;
|
||||
|
||||
@@ -384,7 +384,7 @@ proto.getItem = function (id) {
|
||||
|
||||
// downloader.js downloadUuid
|
||||
if (item.alias)
|
||||
item = this._cache[item.alias];
|
||||
item = item.alias;
|
||||
|
||||
return item;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user