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.disableBubbles) bubbles.SetActive(false);
|
||||||
if (info.disableShaft) shaft.SetActive(false);
|
if (info.disableShaft) shaft.SetActive(false);
|
||||||
if (info.disableSpout) spout.SetActive(false);
|
if (info.disableSpout) spout.SetActive(false);
|
||||||
|
|
||||||
var geyserController = geyserGO.GetComponent<GeyserController>();
|
var geyserController = geyserGO.GetComponent<GeyserController>();
|
||||||
geyserController._activeDuration = info.activeDuration;
|
geyserController._activeDuration = info.activeDuration;
|
||||||
geyserController._inactiveDuration = info.inactiveDuration;
|
geyserController._inactiveDuration = info.inactiveDuration;
|
||||||
@ -66,19 +67,21 @@ namespace NewHorizons.Builder.Props
|
|||||||
oneShotAudio.GetComponent<AudioSpreadController>().SetSector(sector);
|
oneShotAudio.GetComponent<AudioSpreadController>().SetSector(sector);
|
||||||
loopAudio.GetComponent<AudioSpreadController>().SetSector(sector);
|
loopAudio.GetComponent<AudioSpreadController>().SetSector(sector);
|
||||||
|
|
||||||
// Someone might want a geyser just for its force maybe idk
|
Delay.FireOnNextUpdate(() => {
|
||||||
if (info.disableSpout & info.disableShaft & info.disableBubbles)
|
if (info.volume == 0)
|
||||||
{
|
{
|
||||||
oneShotAudio.SetActive(false);
|
oneShotAudio.SetActive(false);
|
||||||
loopAudio.SetActive(false);
|
loopAudio.SetActive(false);
|
||||||
}
|
}
|
||||||
// Disable start/end sounds if its just bubbles
|
else
|
||||||
else if (info.disableSpout & info.disableShaft)
|
{
|
||||||
{
|
oneShotAudio.GetComponent<OWAudioSource>().SetMaxVolume(info.volume);
|
||||||
oneShotAudio.SetActive(false);
|
loopAudio.GetComponent<OWAudioSource>().SetMaxVolume(info.volume);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// If it starts at the shaft, move the start/end sounds to it
|
// 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);
|
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
|
/// Disable the individual particle systems of the geyser
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool disableBubbles, disableShaft, disableSpout;
|
public bool disableBubbles, disableShaft, disableSpout;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loudness of the geyser
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(0.7f)] public float volume = 0.7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user