Merge pull request #960 from knoxHuang/v1.2

fix load prefab bug for fireball/issues/3749
This commit is contained in:
Jare Guo
2016-07-27 10:11:58 +08:00
committed by GitHub
4 changed files with 12 additions and 10 deletions
+5 -3
View File
@@ -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;
+5 -5
View File
@@ -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);
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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);
});
}