feat(ui): 为所有按钮添加全局点击音效
1. 重构按钮点击音效添加方式,通过重写Button原型的_onTouchEnded方法实现全局注入 2. 移除各业务组件中手动添加的按钮音效播放代码,统一音效播放逻辑
This commit is contained in:
@@ -89,6 +89,7 @@ export class HeroViewComp extends CCComp {
|
||||
private onHeroClicked() {
|
||||
if (!this.model) return;
|
||||
if (this.model.fac !== FacSet.HERO) return;
|
||||
oops.audio.playEffect("music/button");
|
||||
|
||||
const eid = this.ent?.eid;
|
||||
if (!eid) return;
|
||||
|
||||
Reference in New Issue
Block a user