mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Change to match SystemCreationHandler
This commit is contained in:
parent
73f819218a
commit
60e0337648
@ -12,16 +12,26 @@ namespace NewHorizons.Builder.Body
|
|||||||
var radius = module.radius;
|
var radius = module.radius;
|
||||||
|
|
||||||
AudioClip clip = null;
|
AudioClip clip = null;
|
||||||
if (!string.IsNullOrEmpty(module.audioClip)) clip = SearchUtilities.FindResourceOfTypeAndName<AudioClip>(module.audioClip);
|
if (!string.IsNullOrEmpty(module.audioClip))
|
||||||
|
{
|
||||||
|
clip = SearchUtilities.FindResourceOfTypeAndName<AudioClip>(module.audioClip);
|
||||||
|
|
||||||
|
if (clip == null)
|
||||||
|
{
|
||||||
|
Utility.Logger.LogError($"Couldn't get audio from clip [{module.audioClip}]");
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (!string.IsNullOrEmpty(module.audioFilePath))
|
else if (!string.IsNullOrEmpty(module.audioFilePath))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
clip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + module.audioFilePath);
|
clip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + module.audioFilePath);
|
||||||
}
|
}
|
||||||
catch (System.Exception e)
|
catch { }
|
||||||
|
|
||||||
|
if (clip == null)
|
||||||
{
|
{
|
||||||
Utility.Logger.LogError($"Couldn't load audio file {module.audioFilePath} : {e.Message}");
|
Utility.Logger.LogError($"Couldn't get audio from file [{module.audioFilePath}]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -160,10 +160,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
clip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + info.audioFilePath);
|
clip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + info.audioFilePath);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch { }
|
||||||
{
|
|
||||||
Logger.LogError($"Couldn't load audio file {info.audioFilePath} : {e.Message}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clip == null)
|
if (clip == null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user