using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Options_menu : MonoBehaviour {

    public GameObject ButtonPrefab;
    public GameObject Canvas;

    private GameObject[] buttons;

    float x = -350;

    // Use this for initialization
    void Start () {

        string[] mic = Microphone.devices;
        buttons = new GameObject[mic.Length];
        for (int i = 0; i < mic.Length; ++i, ++x)
        {
            GameObject newButton = Instantiate(ButtonPrefab) as GameObject;
            newButton.GetComponentInChildren<Text>().text = mic[i] ;
            newButton.transform.SetParent(Canvas.transform, false);
            newButton.transform.localPosition = new Vector2 (x,0);
            newButton.name = mic[i];
            Debug.Log(newButton.name);
            buttons[i]=newButton; 
            x += 300;
       }
    
	}
	

}
