Fixed a bug where state machines and auto play audio on awake fucked me

This commit is contained in:
journaliciouz
2025-10-31 11:19:47 +01:00
parent d48b459fea
commit d0da5d76cd
3 changed files with 26 additions and 115 deletions

View File

@@ -255,8 +255,23 @@ public class AudioManager : MonoBehaviour, IPausable
private void InterruptAudioSource(AppleAudioSource newAudioSource)
{
wasInterrupted = true;
currentlyPlayingVO.InterruptAudio(newAudioSource.name);
//currentlyPlayingVO.InterruptAudio(newAudioSource.name);
InterruptAllVOSources();
ResetAudioSource();
currentlyPlayingVO = newAudioSource;
}
private void InterruptAllVOSources()
{
foreach (AppleAudioSource source in criticalVOSources)
{
source.InterruptAudio("GlobalInterrupt");
}
foreach (AppleAudioSource source in VOSources)
{
source.InterruptAudio("GlobalInterrupt");
}
}
}