UITouch.js 768 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var UITouch = cc.Class({
  2. extends: cc.Component,
  3. // name: "UITouch",
  4. properties: {
  5. //是否关闭Touch
  6. isTouchClose: false,
  7. },
  8. // LIFE-CYCLE CALLBACKS:
  9. // onLoad () {},
  10. start() {
  11. },
  12. TouchStartFunction() {
  13. // cc.log('点击UI屏幕');
  14. if (this.isTouchClose)
  15. return;
  16. this.node.active = false;
  17. },
  18. //设置当前打开的目标
  19. //并且显示
  20. onChangeMaskActive(isActive) {
  21. this.node.active = isActive;
  22. },
  23. // onEnable() {
  24. // this.node.on(cc.Node.EventType.TOUCH_START, this.TouchStartFunction, this);
  25. // },
  26. // onDisable() {
  27. // this.node.off(cc.Node.EventType.TOUCH_START, this.TouchStartFunction, this);
  28. // }
  29. });