void Start () {
UISlider slider = GetComponent<UISlider>();
EventDelegate.Add(slider.onChange, masterVol);
EventDelegate.Add(slider.onChange, soundVol);
EventDelegate.Add(slider.onChange, musicVol);
}
// Update is called once per frame
void Update () {
}
void masterVol()
{
GameObject.Find("Sound").audio.volume = +UISlider.current.value;
GameObject.Find("Music").audio.volume = +UISlider.current.value;
//Debug.Log("Sound volume: " + UISlider.current.value);
}
void soundVol()
{
GameObject.Find("Sound").audio.volume = +UISlider.current.value;
}
void musicVol()
{
GameObject.Find("Music").audio.volume = +UISlider.current.value;
}