mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #960 from knoxHuang/v1.2
fix load prefab bug for fireball/issues/3749
This commit is contained in:
@@ -100,9 +100,11 @@ JS.mixin(LoadingItems.prototype, CallbacksInvoker.prototype, {
|
||||
var item = items[i];
|
||||
var id = item.id;
|
||||
// No duplicated url
|
||||
if (!this.map[id]) {
|
||||
this.map[item.id] = item;
|
||||
list.push(item);
|
||||
if (!this.completed[id]) {
|
||||
if (!this.map[id]) {
|
||||
this.map[id] = item;
|
||||
}
|
||||
list.push(this.map[id]);
|
||||
}
|
||||
}
|
||||
this.totalCount += list.length;
|
||||
|
||||
@@ -351,7 +351,7 @@ JS.mixin(Pipeline.prototype, {
|
||||
* @param {Function} callback
|
||||
* @return {Array} Items accepted by the pipeline
|
||||
*/
|
||||
flowInDeps: function (urlList, callback) {
|
||||
flowInDeps: function (owner, urlList, callback) {
|
||||
var checker = {};
|
||||
|
||||
var items = this._items;
|
||||
@@ -375,12 +375,12 @@ JS.mixin(Pipeline.prototype, {
|
||||
continue;
|
||||
}
|
||||
var item = items.map[url];
|
||||
if ( !item ) {
|
||||
items.addListener(url, loadedCheck);
|
||||
checker[url] = null;
|
||||
if ( item && (url === owner || item.complete) ) {
|
||||
checker[url] = item;
|
||||
}
|
||||
else {
|
||||
checker[url] = item;
|
||||
items.addListener(url, loadedCheck);
|
||||
checker[url] = null;
|
||||
}
|
||||
}
|
||||
var accepted = this.flowIn(urlList);
|
||||
|
||||
@@ -97,7 +97,7 @@ function loadDepends (pipeline, item, asset, tdInfo, deferredLoadRawAssetsInRunt
|
||||
return callback(null, asset);
|
||||
}
|
||||
|
||||
pipeline.flowInDeps(depends, function (items) {
|
||||
pipeline.flowInDeps(uuid, depends, function (items) {
|
||||
var item;
|
||||
for (var src in items) {
|
||||
item = items[src];
|
||||
|
||||
@@ -83,7 +83,7 @@ asyncTest('Load with dependencies', function () {
|
||||
dep2,
|
||||
dep3
|
||||
];
|
||||
this.pipeline.flowInDeps(resources, function (deps) {
|
||||
this.pipeline.flowInDeps(item.id, resources, function (deps) {
|
||||
callback(null, result);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user