Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CONs breaking when selecting restart when paused #204

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Assets/Script/Audio/Bass/BassAudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ public void LoadSong(IEnumerable<string> stems, bool isSpeedUp) {
}

public void LoadMogg(XboxMoggData moggData, bool isSpeedUp) {
Debug.Log("Loading mogg song");
UnloadSong();

int moggOffset = moggData.MoggAddressAudioOffset;
long moggLength = moggData.MoggAudioLength;

Expand Down Expand Up @@ -236,6 +239,7 @@ public void UnloadSong() {

// Free mixer (and all channels in it)
_mixer?.Dispose();
_mixer = null;
}

public void Play() {
Expand Down Expand Up @@ -273,7 +277,7 @@ public void PlaySoundEffect(SfxSample sample) {
}

public void SetStemVolume(SongStem stem, double volume) {
var channel = _mixer.GetChannel(stem);
var channel = _mixer?.GetChannel(stem);

channel?.SetVolume(volume);
}
Expand Down
1 change: 1 addition & 0 deletions Assets/Script/UI/PauseMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private void OnResumeSelected() {
}

private void OnRestartSelected() {
GameManager.AudioManager.UnloadSong();
GameManager.Instance.LoadScene(SceneIndex.PLAY);
Play.Instance.Paused = false;
}
Expand Down