mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 12:33:02 +00:00
24 lines
724 B
C#
24 lines
724 B
C#
using SanAndreasUnity.UI;
|
|
using UnityEngine;
|
|
|
|
namespace SanAndreasUnity.Settings
|
|
{
|
|
public class SoundSettings : MonoBehaviour
|
|
{
|
|
[Range(0f, 1f)] public float defaultSoundVolume = 0.5f;
|
|
|
|
OptionsWindow.FloatInput m_soundVolume = new OptionsWindow.FloatInput ("Sound volume", 0, 1) {
|
|
getValue = () => AudioListener.volume,
|
|
setValue = (value) => { AudioListener.volume = value; },
|
|
persistType = OptionsWindow.InputPersistType.OnStart
|
|
};
|
|
|
|
private void Awake()
|
|
{
|
|
// apply default value
|
|
AudioListener.volume = this.defaultSoundVolume;
|
|
|
|
OptionsWindow.RegisterInputs ("SOUND", m_soundVolume);
|
|
}
|
|
}
|
|
}
|