mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
@@ -45,7 +45,7 @@ function getResWithUrl (res) {
|
||||
if (typeof res === 'object') {
|
||||
result = res;
|
||||
if (res.url) {
|
||||
return res.url;
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
id = res.uuid;
|
||||
@@ -199,7 +199,13 @@ JS.mixin(CCLoader.prototype, {
|
||||
|
||||
_sharedResources.length = 0;
|
||||
for (var i = 0; i < resources.length; ++i) {
|
||||
var res = getResWithUrl(resources[i]);
|
||||
var resource = resources[i];
|
||||
// Backward compatibility
|
||||
if (resource && resource.id) {
|
||||
cc.warn('Sorry, you shouldn\'t use id as item identity any more, please use url or uuid instead, the current id is being set as url: ' + resource.id);
|
||||
resource.url = resource.url || resource.id;
|
||||
}
|
||||
var res = getResWithUrl(resource);
|
||||
if (!res.url && !res.uuid)
|
||||
continue;
|
||||
var item = this.getItem(res.url);
|
||||
|
||||
@@ -142,7 +142,7 @@ module.exports = {
|
||||
* @returns {Boolean} specify whether loaded by pack
|
||||
*/
|
||||
load: function (item, callback) {
|
||||
var uuid = item.id;
|
||||
var uuid = item.uuid;
|
||||
var packUuid = uuidToPack[uuid];
|
||||
if (!packUuid) {
|
||||
return false;
|
||||
|
||||
@@ -88,7 +88,7 @@ var AssetLibrary = {
|
||||
Editor.error('Sorry, the scene data of "%s" is corrupted!', uuid);
|
||||
}
|
||||
else {
|
||||
// We know scene is a raw asset, so we can pass uuid to this API directly
|
||||
// We know scene is not a raw asset, so we can pass uuid to this API directly
|
||||
asset.scene.dependAssets = AutoReleaseUtils.getDependsRecursively(uuid);
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ var AssetLibrary = {
|
||||
}
|
||||
else {
|
||||
if (asset.constructor === cc.SceneAsset) {
|
||||
// We know scene is a raw asset, so we can pass uuid to this API directly
|
||||
// We know scene is not a raw asset, so we can pass uuid to this API directly
|
||||
asset.scene.dependAssets = AutoReleaseUtils.getDependsRecursively(randomUuid);
|
||||
}
|
||||
if (CC_EDITOR || isScene(asset)) {
|
||||
|
||||
Reference in New Issue
Block a user