From dbe2315fa51cfe094924643b61f6a85d8bf04438 Mon Sep 17 00:00:00 2001 From: VDH Date: Thu, 16 Apr 2026 15:47:50 +0700 Subject: [PATCH] fix use skill the second can't hear sfx --- Assets/PerfectWorld/Scripts/Sound/SFXManager.cs | 7 ++----- Assets/Scripts/CECHostPlayer.cs | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/Sound/SFXManager.cs b/Assets/PerfectWorld/Scripts/Sound/SFXManager.cs index 5b18ee5530..dcc260785f 100644 --- a/Assets/PerfectWorld/Scripts/Sound/SFXManager.cs +++ b/Assets/PerfectWorld/Scripts/Sound/SFXManager.cs @@ -95,13 +95,14 @@ namespace BrewMonster.Scripts /// public async UniTaskVoid PlaySkillSfxAtPointAsync(string address, Vector3 worldPos) { + BMLogger.LogError ($"HoangDev PlaySkillSfxAtPointAsync: address={address}, worldPos={worldPos}"); if (string.IsNullOrEmpty(address)) return; var mgr = AddressableManager.Instance; if (mgr == null) return; if (mgr.TryGetCachedAudioClip(address, out var clip) && clip != null) { - AudioSource.PlayClipAtPoint(clip, worldPos, SkillSfxVolume); + AudioSource.PlayClipAtPoint(clip, Vector3.zero, SkillSfxVolume); return; } @@ -180,7 +181,6 @@ namespace BrewMonster.Scripts /// public async UniTaskVoid PlayMoveSoundAsync(int id) { - BMLogger.LogError($"HoangDev PlayMoveSoundAsync: id={id}, source={_moveSoundSource}"); if (_moveSoundSource == null) return; _moveSoundSource.Stop(); @@ -188,12 +188,10 @@ namespace BrewMonster.Scripts if (id <= 0) return; var path = GetSFXPath(id); - BMLogger.LogError($"HoangDev PlayMoveSoundAsync: resolved path='{path}'"); if (string.IsNullOrEmpty(path)) return; if (AddressableManager.Instance.TryGetCachedAudioClip(path, out var clip) && clip != null) { - BMLogger.LogError($"HoangDev PlayMoveSoundAsync: found cached clip='{clip.name}'"); _moveSoundSource.clip = clip; _moveSoundSource.loop = true; _moveSoundSource.Play(); @@ -204,7 +202,6 @@ namespace BrewMonster.Scripts var loaded = await AddressableManager.Instance.LoadAudioClipAsync(path); if (loaded != null) { - BMLogger.LogError($"HoangDev PlayMoveSoundAsync: loaded clip='{loaded.name}'"); _moveSoundSource.clip = loaded; _moveSoundSource.loop = true; _moveSoundSource.Play(); diff --git a/Assets/Scripts/CECHostPlayer.cs b/Assets/Scripts/CECHostPlayer.cs index 2303186947..9e6ac0aea7 100644 --- a/Assets/Scripts/CECHostPlayer.cs +++ b/Assets/Scripts/CECHostPlayer.cs @@ -4212,7 +4212,6 @@ namespace BrewMonster /// private void PlayMoveSound(int id) { - BMLogger.LogError($"HoangDev PlayMoveSound called with id: {id}"); // Debug log to trace sound ID changes if (id == _curMoveSndId) return; _curMoveSndId = id; SFXManager.Instance?.PlayMoveSoundAsync(id).Forget();