Audio volume setting

This commit is contained in:
TerrificTrifid 2022-09-16 22:15:55 -05:00
parent b5d499b2dc
commit 7db8e1c4ef
2 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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]