private void Audio_OnAudioComplete(AudioContainer container) { if (container.Type == AudioContainer.AudioType.effect) { KillAudio(container); } }
private AudioContainer CreateAudioContainer(AudioClip clip, Transform t, AudioContainer.AudioType audioType, float volume) { AudioContainer audio = TJUtils.Instantiate <AudioContainer>(clip.name); audio.OnAudioComplete += Audio_OnAudioComplete; audio.Init(clip, audioType, t, volume); audio.StartAudio(); audioContainers.Add(audio); return(audio); }
public void KillAudio(AudioContainer container) { container.OnAudioComplete -= Audio_OnAudioComplete; audioContainers.Remove(container); container.Kill(); }