12345678910111213141516171819202122232425262728 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class SliderClip : MonoBehaviour {
- public AudioClip SliderAudio;
- private Slider slider;
-
- void Start () {
- slider = GetComponent<Slider>();
- if(slider != null)
- {
- slider.onValueChanged.AddListener(delegate { PlayAudio(); });
- }
- }
- public void PlayAudio()
- {
- if(SliderAudio != null)
- {
- SoundManager.Instance.UIAudioPlay(SliderAudio);
- }
- }
-
-
- }
|