void Start()
    {
        Instance = this;

        for (int i = 0; i < audioObj.Length; i++)
        {
            audioObj[i].player = (GameObject)Instantiate(playerPrefab);
            audioObj[i].player.transform.parent   = transform;
            audioObj[i].player.transform.position = Vector3.zero;
            audioObj[i].clip = new AudioClip();
        }

        inputDevices = new string[Microphone.devices.Length];
        deviceNum    = Microphone.devices.Length - 1;

        for (int i = 0; i < Microphone.devices.Length; i++)
        {
            inputDevices[i] = Microphone.devices[i].ToString();
        }

        CurrentAudioInput = Microphone.devices[deviceNum].ToString();

        InvokeRepeating("Check", 0, 1.0f / 15.0f);
        StartCoroutine(StartRecord());
    }
Пример #2
0
 public AudioHandler(VoiceControl voiceControl)
 {
     timerPlay = new Timer();
     timerPlay.Interval = 1000;
     timerPlay.Tick += new System.EventHandler(OnTimerPlayEvent);
     timerPlay.Enabled = false;
     this.voiceControl = voiceControl;
 }
Пример #3
0
 // Start is called before the first frame update
 void Start()
 {
     rb           = GetComponent <Rigidbody2D>();
     Player       = GameObject.FindGameObjectWithTag("Player");
     voiceControl = Player.GetComponent <VoiceControl>();
     rb.velocity  = new Vector2(0, voiceControl.GetUIMoveSpeed());
     Destroy(gameObject, voiceControl.GetUIDuration());
 }
Пример #4
0
    void Start()
    {
        Instance = this;

        for (int i = 0; i < audioObj.Length; i++)
        {
            audioObj[i].player = (GameObject)Instantiate(playerPrefab);
            audioObj[i].player.transform.parent = transform;
            audioObj[i].player.transform.position = Vector3.zero;
            audioObj[i].clip = new AudioClip();
        }

        inputDevices = new string[Microphone.devices.Length];
        deviceNum = Microphone.devices.Length - 1;

        for (int i = 0; i < Microphone.devices.Length; i++)
            inputDevices[i] = Microphone.devices[i].ToString();

        CurrentAudioInput = Microphone.devices[deviceNum].ToString();

        InvokeRepeating("Check", 0, 1.0f / 15.0f);
        StartCoroutine(StartRecord());
    }
Пример #5
0
    private void Start()
    {
        GameObject ship = GameObject.FindGameObjectWithTag("Player");

        vc = ship.GetComponent <VoiceControl>();
    }
Пример #6
0
 public KeyboardHandler(VoiceControl voiceControl)
 {
     this.voiceControl = voiceControl;
 }