Example #1
0
    public void PlayAudio(string name)
    {
        GameObject    go   = new GameObject();
        GameAudioItem item = go.AddComponent <GameAudioItem>();

        item.PlayAudio(name);
    }
Example #2
0
    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));
        }
    }