Merge pull request #3 from zty8023ys/master

Off event
This commit is contained in:
异名 2020-12-06 23:11:52 +08:00 committed by GitHub
commit c9ebd90d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,8 +22,8 @@ export default class Scratch_ticket extends cc.Component {
beforeDestroy() { beforeDestroy() {
this.ticketNode.off(cc.Node.EventType.TOUCH_START, this.touchStartEvent, this); this.ticketNode.off(cc.Node.EventType.TOUCH_START, this.touchStartEvent, this);
this.ticketNode.off(cc.Node.EventType.TOUCH_MOVE, this.touchMoveEvent, this); this.ticketNode.off(cc.Node.EventType.TOUCH_MOVE, this.touchMoveEvent, this);
this.ticketNode.on(cc.Node.EventType.TOUCH_END, this.touchEndEvent, this); this.ticketNode.off(cc.Node.EventType.TOUCH_END, this.touchEndEvent, this);
this.ticketNode.on(cc.Node.EventType.TOUCH_CANCEL, this.touchEndEvent, this); this.ticketNode.off(cc.Node.EventType.TOUCH_CANCEL, this.touchEndEvent, this);
} }
touchStartEvent(event) { touchStartEvent(event) {