public void PlayAudio(string name) { GameObject go = new GameObject(); GameAudioItem item = go.AddComponent <GameAudioItem>(); item.PlayAudio(name); }
private IEnumerator PlayAudioSync(List <string> list) { for (int i = 0; i < list.Count; i++) { GameObject go = new GameObject(); GameAudioItem item = go.AddComponent <GameAudioItem>(); float length = item.PlayAudio(list[i]); yield return(new WaitForSeconds(length)); } }