mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Add _renderComponent cache to Node
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user