PickUpClip.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using WebTools.SoundSystem.Datas;
  5. namespace WebTools.SoundSystem.Behaviours
  6. {
  7. public class PickUpClip : MonoBehaviour
  8. {
  9. public AudioClip audioClip;
  10. public SoundTypes.TypeAudio typeAudio;
  11. private void OnMouseDown()
  12. {
  13. if (audioClip != null)
  14. {
  15. switch (typeAudio)
  16. {
  17. case SoundTypes.TypeAudio.FX:
  18. SoundManager.Instance.FXAudioPlay(audioClip);
  19. break;
  20. case SoundTypes.TypeAudio.Ambient:
  21. SoundManager.Instance.AmbientAudioPlay(audioClip);
  22. break;
  23. case SoundTypes.TypeAudio.UI:
  24. SoundManager.Instance.UIAudioPlay(audioClip);
  25. break;
  26. case SoundTypes.TypeAudio.Music:
  27. SoundManager.Instance.MusicAudioPlay(audioClip);
  28. break;
  29. }
  30. }
  31. }
  32. }
  33. }