(function(){
var Super = function(){};
Super.prototype = cc.Button.prototype;
//实例化原型
Super.prototype._onTouchEnded = function (t) {
if (this.interactable && this.enabledInHierarchy) {
var callback = t.currentTarget._bubblingListeners._callbackTable.touchend.targets[0].clickEvents.length;
if(callback != 0){
cc.hb.audioMgr.playEffect("click", false);//播放Button音效
}
//t.currentTarget._bubblingListeners._callbackTable.touchend.targets[0].clickEvents[0].handler//获取Button脚本挂载的事件名
if (this._pressed) {
cc.Component.EventHandler.emitEvents(this.clickEvents, t);
this.node.emit("click", this);
}
this._pressed = !1;
this._updateState();
t.stopPropagation();
}
};
})();
获取Button脚本挂载的事件名
最新推荐文章于 2022-10-13 17:50:34 发布