void Awake() { if (instance == null) { instance = this; } source = GetComponent <AudioSource>(); }
public void PlayEffect(int _index, float _delay = 0, bool _breath = false) { AudioClip clip = soundsArray[_index] as AudioClip; source.clip = clip; source.PlayDelayed(_delay); if (_breath) { CharacterBreathEffect.Getinstance().PlayBreath(); } }