IEnumerator IRetrive(AudioSource source, float t) { yield return(new WaitForSeconds(t)); source.Stop(); _audioSouces.Retrive(source); }
public void Init(int count) { GameObject gb = new GameObject("SFX"); gb.transform.parent = transform; var s = gb.AddComponent <AudioSource>(); _audioSouces = new ComponentPool <AudioSource>(count, gb, transform); _audioSouces.Retrive(s); }