(function(){
var Super = function(){};
Super.prototype = cc.Button.prototype;
//实例化原型
Super.prototype._onTouchEnded = function (t) {
if (this.interactable && this.enabledInHierarchy) {
cc.hb.audioMgr.playEffect("click", false);//播放按钮Button音频
if (this._pressed) {
cc.Component.EventHandler.emitEvents(this.clickEvents, t);
this.node.emit("click", this);
}
this._pressed = !1;
this._updateState();
t.stopPropagation();
}
};
})();
cocos creator 重写源码按钮Button点击音频封装
最新推荐文章于 2024-06-28 12:22:13 发布