cc.Class({ extends: cc.Component, properties: { targetNode: { default: null, // The default value will be used only when the component attaching // to a node for the first time type: cc.Node, // optional, default is typeof default serializable: true, // optional, default is true } }, Open() { this.targetNode.active = true; } });