12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using WebTools.SoundSystem.Datas;
- public class ObjectClip : MonoBehaviour {
- public AudioClip ObjectAudio;
- public SoundTypes.TypeAudio typeAudio;
- public bool active = false;
- private void Start()
- {
- if(!active)
- {
- if (ObjectAudio != null)
- {
- switch (typeAudio)
- {
- case SoundTypes.TypeAudio.FX:
- SoundManager.Instance.FXAudioPlay(ObjectAudio);
- active = true;
- break;
- case SoundTypes.TypeAudio.Ambient:
- SoundManager.Instance.AmbientAudioPlay(ObjectAudio);
- break;
- case SoundTypes.TypeAudio.UI:
- SoundManager.Instance.UIAudioPlay(ObjectAudio);
- break;
- case SoundTypes.TypeAudio.Music:
- SoundManager.Instance.MusicAudioPlay(ObjectAudio);
- break;
- }
- }
- }
- }
- }
|