active must synchronize to component

This commit is contained in:
SijieWang
2018-05-07 18:01:58 +08:00
parent 06b1965b8c
commit 0e854f3cc4
+9 -1
View File
@@ -2460,6 +2460,15 @@ var Node = cc.Class({
var self = this;
var sgNode = self._sgNode;
// `active` must synchronize to component
for (var i=0; i<this._components.length; i++) {
var comp = this._components[i];
if (!comp || !comp._sgNode) {
continue;
}
comp._sgNode.visible = this.active;
}
sgNode.setPosition(self._position);
sgNode.setRotationX(self._rotationX);
sgNode.setRotationY(self._rotationY);
@@ -2529,7 +2538,6 @@ var Node = cc.Class({
}
}
}
sizeProvider.visible = this.active;
}
var sgParent = this._parent && this._parent._sgNode;