mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add more audio volume properties
This commit is contained in:
parent
b1338002ec
commit
3dd77773ec
@ -52,6 +52,12 @@ namespace NewHorizons.Builder.Volumes
|
||||
AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod);
|
||||
|
||||
var audioVolume = go.AddComponent<AudioVolume>();
|
||||
audioVolume._layer = info.layer;
|
||||
audioVolume.SetPriority(info.priority);
|
||||
audioVolume._fadeSeconds = info.fadeSeconds;
|
||||
audioVolume._noFadeFromBeginning = info.noFadeFromBeginning;
|
||||
audioVolume._randomizePlayhead = info.randomizePlayhead;
|
||||
audioVolume._pauseOnFadeOut = info.pauseOnFadeOut;
|
||||
|
||||
var shape = go.AddComponent<SphereShape>();
|
||||
shape.radius = info.radius;
|
||||
|
||||
23
NewHorizons/External/Modules/VolumesModule.cs
vendored
23
NewHorizons/External/Modules/VolumesModule.cs
vendored
@ -180,7 +180,7 @@ namespace NewHorizons.External.Modules
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class AudioVolumeInfo : VolumeInfo
|
||||
public class AudioVolumeInfo : PriorityVolumeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
||||
@ -203,6 +203,27 @@ namespace NewHorizons.External.Modules
|
||||
[Range(0f, 1f)]
|
||||
[DefaultValue(1f)]
|
||||
public float volume = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// How long it will take to fade this sound in and out when entering/exiting this volume.
|
||||
/// </summary>
|
||||
[DefaultValue(2f)]
|
||||
public float fadeSeconds = 2f;
|
||||
|
||||
/// <summary>
|
||||
/// Play the sound instantly without any fading.
|
||||
/// </summary>
|
||||
public bool noFadeFromBeginning;
|
||||
|
||||
/// <summary>
|
||||
/// Randomize what time the audio starts at.
|
||||
/// </summary>
|
||||
public bool randomizePlayhead;
|
||||
|
||||
/// <summary>
|
||||
/// Pause the music when exiting the volume.
|
||||
/// </summary>
|
||||
public bool pauseOnFadeOut;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user