Merge pull request #2537 from pandamicro/optimize

Fix render component chain not updated for one child
This commit is contained in:
pandamicro
2018-04-13 22:56:56 +08:00
committed by GitHub
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -2453,9 +2453,9 @@ var Node = cc.Class({
}
_children[j + 1] = child;
}
hierarchyChain.rebuild(this);
this.emit(CHILD_REORDER);
}
hierarchyChain.rebuild(this);
cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE, this.sortAllChildren, this);
}
},
@@ -70,10 +70,6 @@ var RenderComponent = cc.Class({
onDisable () {
this.node._renderComponent = null;
// When parent children order dirty, its children's render component will be rechained in sortAllChildren
if (!this.node.parent._reorderChildDirty) {
hierarchyChain.rebuildSelf(this.node);
}
},
onDestroy () {
@@ -319,6 +319,9 @@ RenderComponentWalker.prototype = {
for (; entry; entry = entry.next) {
let comp = entry.comp;
let node = comp.node;
if (!comp._enabled || !node._activeInHierarchy) {
continue;
}
let assembler = null;
// Pre handle