mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Merge pull request #2537 from pandamicro/optimize
Fix render component chain not updated for one child
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user