cc.Class({ extends: cc.Component, properties: { clcicknode: { default: null, type: cc.Node, displayName: "点击的节点" }, startTime: { default: 0, displayName: "起始延迟时间" }, returnDelayTime: { default: -1, displayName: "返回延迟的时间,负数为不返回" }, eventNode_over: { default: null, type: cc.Node, displayName: "结束事件节点" }, hideNode: { type: cc.Node, default: [], displayName: "需要隐藏的节点" } }, start: function () { this.clcicknode.on(cc.Node.EventType.TOUCH_START, this.switchEvent2, this); this.canClike = true; }, switchEvent2: function () { var e = this; if (this.canClike) { console.log("点击了"); if (this.hideNode) { for (var o = 0; o < this.hideNode.length; o++) { this.hideNode[o].active = false; } } cc.tween(this.clcicknode).delay(this.startTime).call(function () { e.canClike = false; if (e.eventNode_over) { console.log("结束"); e.eventNode_over.switchEvent(); } }).start(); } }, returnStartPos: function () {}, restoreEvent: function () {} });