抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

slider.onValueChanged.AddListener

slider.onValueChanged.AddListener((float v) =>
{//v等价于slider.value
AudioTuning.Instance.SetMasterVolume(v);
});

AudioTuning:

public class AudioTuning : SingLeton<AudioTuning>
{
[SerializeField] AudioMixer audioMixer;
public void SetMasterVolume(float volume)
{
audioMixer.SetFloat("MasterVolume", volume);
}
}

评论