CloseBtn.js 457 B

12345678910111213141516
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. targetNode: {
  5. default: null, // The default value will be used only when the component attaching
  6. // to a node for the first time
  7. type: cc.Node, // optional, default is typeof default
  8. serializable: true, // optional, default is true
  9. }
  10. },
  11. Close()
  12. {
  13. this.targetNode.active = false;
  14. }
  15. });