public int PlayEffect(eEffectSound _soundEffect) { int index = audioIndex; SetEffect(_soundEffect, effectList[( int )_soundEffect].volume, false); return(index); }
private void SetEffect(eEffectSound _soundEffect, float _volume, bool _loop) { effectAudio[audioIndex].Stop(); effectAudio[audioIndex].clip = effectList[( int )_soundEffect].clip; effectAudio[audioIndex].volume = _volume; effectAudio[audioIndex].loop = _loop; effectAudio[audioIndex].Play(); audioIndex = (audioIndex + 1) % effectAudio.Count; }