public AudioSource FindAudioSource(SFXType.SoundType type) { foreach (GameObject g in audios) { if (g.GetComponent <SFXType>().type == type) { return(g.GetComponent <AudioSource>()); } } return(null); //Esto no se ejecutará nunca }
public void PlaySFX(SFXType.SoundType type) { FindAudioSource(type).Play(); }