Add _renderComponent cache to Node

This commit is contained in:
pandamicro
2017-12-03 10:43:58 +08:00
parent 4afba5d567
commit d98d0a7235
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -834,6 +834,7 @@ var Node = cc.Class({
// cache component
this._widget = null;
this._renderComponent = null;
// Touch event listener
this._touchListener = null;
// Mouse event listener
+2
View File
@@ -475,11 +475,13 @@ var Sprite = cc.Class({
onEnable: function () {
this._activateMaterial();
this.node._renderComponent = this;
},
onDisable: function () {
RenderData.free(this._renderData);
this._renderData = null;
this.node._renderComponent = null;
},
_activateMaterial: function () {