feat(ui): 为所有按钮添加全局点击音效

1. 重构按钮点击音效添加方式,通过重写Button原型的_onTouchEnded方法实现全局注入
2. 移除各业务组件中手动添加的按钮音效播放代码,统一音效播放逻辑
This commit is contained in:
panFD
2026-06-13 16:56:41 +08:00
parent 10ab03b871
commit d926c08582
5 changed files with 21 additions and 1 deletions

View File

@@ -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;