咋样才能在执行动作的时候屏蔽事件

toddlxt
Tue, 20 Dec 2016 07:44:23 +0000

动作开始时屏蔽事件
cc.eventManager.pauseTarget(this.node, true);
动作结束后恢复事件
cc.eventManager.resumeTarget(this.node, true);
http://cocos.com/docs/creator/api/classes/eventManager.html#method_pauseTarget

或者playerS中jump开始时设置playerS.jumping = true，结束后playerS.jumping =false;
touchend事件中判断playerS.jumping === false再调用playerS.jumpOnce。

阅读整个主题