mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
commit
b5a4c9f7ca
@ -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);
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
@ -134,6 +135,13 @@ 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>
|
||||
[Range(0f, 1f)]
|
||||
[DefaultValue(1f)]
|
||||
public float volume = 1f;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
@ -2501,6 +2501,14 @@
|
||||
"type": "boolean",
|
||||
"description": "Whether to loop this audio while in this audio volume or just play it once",
|
||||
"default": true
|
||||
},
|
||||
"volume": {
|
||||
"type": "number",
|
||||
"description": "The loudness of the audio",
|
||||
"format": "float",
|
||||
"default": 1.0,
|
||||
"maximum": 1.0,
|
||||
"minimum": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user