Cocos Creator 按钮音效封装重写
2018-08-14 01:18 罗任德 阅读(2803) 评论(0) 编辑 收藏 举报cc.Button.prototype._onTouchEnded = function (t) {
cc.hb.audioMgr.playMusic("click", false);//播放音频
if (this.interactable && this.enabledInHierarchy) {
if (this._pressed) {
cc.Component.EventHandler.emitEvents(this.clickEvents, t);
this.node.emit("click", this);
}
this._pressed = !1;
this._updateState();
t.stopPropagation();
}
};