示例#1
0
    // Start is called before the first frame update
    async void Start()
    {
        AudioSource audioSource = gameObject.AddComponent <AudioSource>();

        AudioClipController controller = new AudioClipController();
        await controller.LoadAudioClipWithWebRequest(TEST_EFFECT_PATH, AudioType.WAV);

        controller.SetFadeOutCurve();

        audioSource.clip = controller.GetAudioClip();

        audioSource.Play();
    }
 public override void PlaySound()
 {
     audioSource.PlayOneShot(clipController.GetAudioClip());
 }
示例#3
0
 public AudioClip GetAudioClip()
 {
     return(clipController.GetAudioClip());
 }
示例#4
0
 public virtual void SetAudioClip(AudioClipController controller)
 {
     audioSource.clip = controller.GetAudioClip();
 }