mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Audio volume setting
This commit is contained in:
parent
b5d499b2dc
commit
7db8e1c4ef
@ -46,6 +46,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var owAudioSource = go.AddComponent<OWAudioSource>();
|
||||
owAudioSource._audioSource = audioSource;
|
||||
owAudioSource.loop = info.loop;
|
||||
owAudioSource.SetMaxVolume(info.volume);
|
||||
owAudioSource.SetTrack((OWAudioMixer.TrackName)Enum.Parse(typeof(OWAudioMixer.TrackName), Enum.GetName(typeof(AudioMixerTrackName), info.track)));
|
||||
AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod);
|
||||
|
||||
|
||||
@ -134,6 +134,11 @@ namespace NewHorizons.External.Modules
|
||||
/// Whether to loop this audio while in this audio volume or just play it once
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool loop = true;
|
||||
|
||||
/// <summary>
|
||||
/// The loudness of the audio
|
||||
/// </summary>
|
||||
[DefaultValue(1f)] public float volume = 1f;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user