Geyser volume

This commit is contained in:
TerrificTrifid 2022-08-10 13:39:27 -05:00
parent cc397f89fb
commit 17be25189d
2 changed files with 20 additions and 12 deletions

View File

@ -39,6 +39,7 @@ namespace NewHorizons.Builder.Props
if (info.disableBubbles) bubbles.SetActive(false);
if (info.disableShaft) shaft.SetActive(false);
if (info.disableSpout) spout.SetActive(false);
var geyserController = geyserGO.GetComponent<GeyserController>();
geyserController._activeDuration = info.activeDuration;
geyserController._inactiveDuration = info.inactiveDuration;
@ -66,19 +67,21 @@ namespace NewHorizons.Builder.Props
oneShotAudio.GetComponent<AudioSpreadController>().SetSector(sector);
loopAudio.GetComponent<AudioSpreadController>().SetSector(sector);
// Someone might want a geyser just for its force maybe idk
if (info.disableSpout & info.disableShaft & info.disableBubbles)
Delay.FireOnNextUpdate(() => {
if (info.volume == 0)
{
oneShotAudio.SetActive(false);
loopAudio.SetActive(false);
}
// Disable start/end sounds if its just bubbles
else if (info.disableSpout & info.disableShaft)
else
{
oneShotAudio.SetActive(false);
oneShotAudio.GetComponent<OWAudioSource>().SetMaxVolume(info.volume);
loopAudio.GetComponent<OWAudioSource>().SetMaxVolume(info.volume);
}
});
// If it starts at the shaft, move the start/end sounds to it
else if ((info.disableSpout & !info.disableShaft) | info.offset == -67f)
if ((info.disableSpout & !info.disableShaft) | info.offset == -67f)
{
oneShotAudio.transform.SetLocalPositionY(67f);
}

View File

@ -258,6 +258,11 @@ namespace NewHorizons.External.Modules
/// Disable the individual particle systems of the geyser
/// </summary>
public bool disableBubbles, disableShaft, disableSpout;
/// <summary>
/// Loudness of the geyser
/// </summary>
[DefaultValue(0.7f)] public float volume = 0.7f;
}
[JsonObject]