Fix move sfx not stop

This commit is contained in:
Tran Hai Nam
2026-04-24 17:49:20 +07:00
parent d3a7983637
commit d43f50e826
2 changed files with 14 additions and 2 deletions
@@ -219,5 +219,10 @@ namespace BrewMonster.Scripts
_moveSoundSource.Play();
}
}
public async UniTaskVoid StopMoveSoundAsync()
{
if (_moveSoundSource == null) return;
_moveSoundSource.Stop();
}
}
}
+9 -2
View File
@@ -4213,7 +4213,7 @@ namespace BrewMonster
}
else
{
newId = 164;
newId = 0;
}
PlayMoveSound(newId);
@@ -4227,7 +4227,14 @@ namespace BrewMonster
{
if (id == _curMoveSndId) return;
_curMoveSndId = id;
SFXManager.Instance?.PlayMoveSoundAsync(id).Forget();
if(id > 0)
{
SFXManager.Instance?.PlayMoveSoundAsync(id).Forget();
}
else
{
SFXManager.Instance?.StopMoveSoundAsync().Forget();
}
}
/// <summary>