Change travel music on next update

This commit is contained in:
Noah Pilarski 2022-06-14 22:02:43 -04:00
parent 60e0337648
commit 29a9c239f3

View File

@ -54,12 +54,15 @@ namespace NewHorizons.Handlers
if (clip != null) if (clip != null)
{ {
var travelSource = Locator.GetGlobalMusicController()._travelSource; Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() =>
travelSource._audioLibraryClip = AudioType.None; {
travelSource._clipArrayIndex = 0; var travelSource = Locator.GetGlobalMusicController()._travelSource;
travelSource._clipArrayLength = 0; travelSource._audioLibraryClip = AudioType.None;
travelSource._clipSelectionOnPlay = OWAudioSource.ClipSelectionOnPlay.MANUAL; travelSource._clipArrayIndex = 0;
travelSource.clip = clip; travelSource._clipArrayLength = 0;
travelSource._clipSelectionOnPlay = OWAudioSource.ClipSelectionOnPlay.MANUAL;
travelSource.clip = clip;
});
} }
} }
} }