test.ts 480 B

123456789101112131415161718192021
  1. import { _decorator, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('test')
  4. export class test extends Component {
  5. start() {
  6. this.node.on(Node.EventType.TOUCH_START,()=>{
  7. console.log("TOUCH_START")
  8. })
  9. this.node.on(Node.EventType.TOUCH_MOVE,()=>{
  10. console.log("TOUCH_MOVE")
  11. })
  12. this.node.on(Node.EventType.TOUCH_END,()=>{
  13. console.log("TOUCH_END")
  14. })
  15. }
  16. }