implement music

This commit is contained in:
Noah Pilarski 2025-01-25 06:02:10 -05:00
parent 2af8686818
commit a8f48fcb54
3 changed files with 8 additions and 3 deletions

View File

@ -21,9 +21,10 @@ namespace NewHorizons.Handlers
_customAudioTypes = new Dictionary<string, AudioType>(); _customAudioTypes = new Dictionary<string, AudioType>();
_audioEntries = new List<AudioLibrary.AudioEntry>(); _audioEntries = new List<AudioLibrary.AudioEntry>();
Delay.RunWhen( Delay.RunWhenAndInNUpdates(
PostInit,
() => Locator.GetAudioManager()?._libraryAsset != null, () => Locator.GetAudioManager()?._libraryAsset != null,
PostInit 1
); );
} }

View File

@ -55,7 +55,9 @@ namespace NewHorizons.Handlers
if (!string.IsNullOrEmpty(config.music)) if (!string.IsNullOrEmpty(config.music))
{ {
//TODO: Implement var musicSource = SearchUtilities.Find("Scene/AudioSource_Music").GetComponent<OWAudioSource>();
var audioType = AudioTypeHandler.GetAudioType(config.music, mod);
Delay.FireOnNextUpdate(() => musicSource.AssignAudioLibraryClip(audioType));
} }
if (config.MenuPlanet != null) if (config.MenuPlanet != null)

View File

@ -422,6 +422,8 @@ namespace NewHorizons
if (isTitleScreen && CustomTitleScreen) if (isTitleScreen && CustomTitleScreen)
{ {
AudioTypeHandler.Init();
try try
{ {
TitleSceneHandler.DisplayBodyOnTitleScreen(BodyDict.Values.ToList().SelectMany(x => x).ToList()); TitleSceneHandler.DisplayBodyOnTitleScreen(BodyDict.Values.ToList().SelectMany(x => x).ToList());