blob: cadeddb4c00fe1126812e487312f74a6e006c8b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
using UnityEngine;
public class SettingsAudioVolume : MonoBehaviour
{
public TFUISlider target;
public SettingsManager.MixerChannel channel;
private void OnEnable()
{
if (SettingsManager.Instance != null)
{
target.SetValue(SettingsManager.Instance.GetAudioVolume(channel));
}
}
private void Start()
{
target.onChange.AddListener(OnChange);
}
private void OnChange()
{
SettingsManager.Instance.SetAudioValue(target.value, channel);
}
}
|