コード例 #1
0
ファイル: PlayerSub.cs プロジェクト: gitshuaidong/MJ
    public void ShowVoice(byte[] data, MicrophoneInput mic)
    {
        showVoice = true;
        detail.TalkingFlag_Image.gameObject.SetActive(showVoice);
        float length = mic.Play(data);

        Game.Delay(length, () =>
        {
            showVoice = false;
            detail.TalkingFlag_Image.gameObject.SetActive(showVoice);
        });
    }
コード例 #2
0
    public void InputSelectValueChangedHandler(Dropdown mic)
    {
        string selectedInput = options[inputSelect.value];

        switch (selectedInput)
        {
        case "Music":
            audioVizualizer.audioSource = music.GetAudioSource();
            music.Play();
            microphone.Stop();
            break;

        case "Microphone":
            audioVizualizer.audioSource = microphone.GetAudioSource();
            music.Pause();
            microphone.Play();
            break;
        }
    }