mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Geyser volume
This commit is contained in:
parent
cc397f89fb
commit
17be25189d
@ -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)
|
||||
{
|
||||
oneShotAudio.SetActive(false);
|
||||
loopAudio.SetActive(false);
|
||||
}
|
||||
// Disable start/end sounds if its just bubbles
|
||||
else if (info.disableSpout & info.disableShaft)
|
||||
{
|
||||
oneShotAudio.SetActive(false);
|
||||
}
|
||||
Delay.FireOnNextUpdate(() => {
|
||||
if (info.volume == 0)
|
||||
{
|
||||
oneShotAudio.SetActive(false);
|
||||
loopAudio.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
5
NewHorizons/External/Modules/PropModule.cs
vendored
5
NewHorizons/External/Modules/PropModule.cs
vendored
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user